From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81F9FC27C77 for ; Fri, 14 Jun 2024 06:31:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E09EA6B00C6; Fri, 14 Jun 2024 02:29:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB9456B00CB; Fri, 14 Jun 2024 02:29:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C81126B00CD; Fri, 14 Jun 2024 02:29:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id AB1D86B00C6 for ; Fri, 14 Jun 2024 02:29:39 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 2ABF214014C for ; Fri, 14 Jun 2024 06:29:39 +0000 (UTC) X-FDA: 82228518078.13.9EA91ED Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by imf26.hostedemail.com (Postfix) with ESMTP id 4AC61140009 for ; Fri, 14 Jun 2024 06:29:37 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R4q2FK09; spf=pass (imf26.hostedemail.com: domain of adobriyan@gmail.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=adobriyan@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718346576; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Pn3XIo1FDmmSG/nyq3G2IvjJub61mr4heaF3EjMELcs=; b=4XMT2wwpGMWXjOlmfxl9QtwKjj7Qn55NCCCT7k91b1i36RD4wW1uubJBGSSTCtsaGYOrik 8CTl/yJPi5i86wUwZdvNaNduzhOnMPuMPZvCsSK5tbpKABkR9uHiDZDeKkPjYj8X0M5/yo 6CemhfZjyPRNJH/70LPqgor0l4shpAc= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=R4q2FK09; spf=pass (imf26.hostedemail.com: domain of adobriyan@gmail.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=adobriyan@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718346576; a=rsa-sha256; cv=none; b=Ua10uu2JciP8nMtzWsMTMTbfaZDHDZOlfS4wNp5AqJRD1SNHzD9iDFyt5x0KYZH/bAo/jj qZbZiTyZ8qDFiwvVw4//jIIQDl8nPpVe+ivWvUf05rKGaPwiAGlq0K3w40CdQCnojRJwga K7EQwsvhia/uadWrjQGCnNI/MA47bqQ= Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35f2266edd8so1378793f8f.0 for ; Thu, 13 Jun 2024 23:29:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718346576; x=1718951376; darn=kvack.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Pn3XIo1FDmmSG/nyq3G2IvjJub61mr4heaF3EjMELcs=; b=R4q2FK09kSwHbtjhvJ+kZxNus9rgYyTOObsLlOnqDp3WrmO9aqTvka5fa1c2M82D5S wOVCS6q4Jo6v2pX6VBmsUyhonOSB73WA4/fHjC6cUANPl99I6UXa6CzeGsK6kMelUiCu gY3sFLM0hOm8RALuUpGK493vTueJjYN/1TqyofavCNw+MbMNhvxhiJhlV15flXLLbiAU dz9SKla6rXHP20alE8LcGM1i8H58XC4+TjN8teBb6dktVLMer42vessmv1MobMoC61r9 Kv3cbjWKWBNtVRFusofoGjLNWrFWjB5zLLZxtnJOe0T6f+uAKQnPLRYuVZ4qmM/l7iQZ p9bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718346576; x=1718951376; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Pn3XIo1FDmmSG/nyq3G2IvjJub61mr4heaF3EjMELcs=; b=is+1U5lwEYtafWxYgIHFQ/UQHkp86xJHn/mrc8uRP4FH738ghvXE8FVrUe8PHHp5KE 3gPKWV5aRHfzzzBtUVwD9GyqVLbIM+BHuNsIwIpq4eH/091HGaYm9yyDVD28H3eazTil OFfmve6npoUn2hCX8Euv5wev2X+DnM0BMbSuNl1s9HwNCdgMi1RdBvbstxYtTq8rKVAW bn+KzUztkrU6EctEA0uCH2BKuCpotcPWxKL+tEfFI1tI5EhHJbZ1A+GIKD05YSpbpUpm x8zFqR3xbJWQfoteZhx5aFxJdalnRfBEQIlx8eVsb0p6VPJmBKziUpQtoM0McnhZipXZ Tgsg== X-Forwarded-Encrypted: i=1; AJvYcCWcdCrwVKPcdJos2hpZ8C+3G7Qz7Dv/6c5Si8IT3WXQQDX6HuUNM9voqQBct9p3uI/2+udwaJ69VELVsgybMD3maMM= X-Gm-Message-State: AOJu0YzJ0+xjLs+WkmnJ0RwspTp8ibigkge6tmBX7niGJDU0gveGE9Xg lFzcWw7ezLmGHIPQ9citXX82+oUsL8wkVE4m0FWXHNr9uIAYiDo= X-Google-Smtp-Source: AGHT+IG8Z2kEHMwew0brh1MHGINbTrdni8vxAnQtTIKV5S9wlZUJGOv8+54ZNV5mmL6RR9yKHmRHqA== X-Received: by 2002:a05:6000:1289:b0:35f:1c6b:2b24 with SMTP id ffacd0b85a97d-3607a7610bemr1180861f8f.29.1718346575485; Thu, 13 Jun 2024 23:29:35 -0700 (PDT) Received: from p183 ([46.53.250.241]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607509355dsm3449841f8f.13.2024.06.13.23.29.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:29:34 -0700 (PDT) Date: Fri, 14 Jun 2024 09:29:33 +0300 From: Alexey Dobriyan To: Steven Rostedt Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] linux++: delete some forward declarations Message-ID: <3efb99f7-ddef-4958-9c83-4e1009b1a914@p183> References: <5ad5556c-7c32-45b7-89cf-f723c9d7332b@p183> <20240613153402.3b067d4b@rorschach.local.home> <20240613130420.a62ed8965a73b0f8d35890d4@linux-foundation.org> <20240613161012.1dd2ff60@rorschach.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240613161012.1dd2ff60@rorschach.local.home> X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 4AC61140009 X-Stat-Signature: enbho43d5dwnzkku3kwfrcydcqwibyj5 X-HE-Tag: 1718346577-104556 X-HE-Meta: U2FsdGVkX18qxr1X2lDg8o9vtX0sC36YucgqKhGGb07JBw6doDzzO5Rz5t7oM/MuCdTbMT0KqQs4n8i/NlxqnzEqFamPU1CKjV7P5jGQE/BTep+e8qC5x3xurrDCQJf6T1DgPXBu18Qhc3WqJFRMkBb6f0poeIRRvMHTb/77nTcIquA6m8qnBuS8yZ6h7BVa1iKDMMI1z/2eyDZCX7Uh984n1LbCyuJU16Ue7fG481B4B7fic6WnZY91pcYuVA/MTdmwCWNulkazd26NEsr/k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CKDkUqdDLTaWpqdRsoIPBXAvlHlvSv6luj4lb/UGW+znS7OV2WGPs/x9jAWrJtnA2l0B+F4LJdXfLG29Rf0PkEyLUoNyMNkF8R7M+iWAn+HEhbliyuOOQSE3CY6ro7RkL77baSCYYpk3KA5N8wSgK4R2HLhw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Jun 13, 2024 at 04:10:12PM -0400, Steven Rostedt wrote: > On Thu, 13 Jun 2024 13:04:20 -0700 > Andrew Morton wrote: > > > On Thu, 13 Jun 2024 15:34:02 -0400 Steven Rostedt wrote: > > > > > On Thu, 13 Jun 2024 22:22:18 +0300 > > > Alexey Dobriyan wrote: > > > > > > > g++ doesn't like forward enum declarations: > > > > > > > > error: use of enum ā€˜E’ without previous declaration > > > > 64 | enum E; > > > > > > But we don't care about g++. Do we? > > > > It appears that g++ is a useful enum declaration detector. > > > > I'm curious to know how even the above warning was generated. Does g++ > > work at all on Linux? With out-of-tree patch, yes. What happens is that "enum E;" works in C but doesn't work in C++. The fix (in C++) is to either delete, or change to "enum E:int;". The same applies to const struct S s; const struct S s = {}; First declaration is compile error in C++, sometimes it can be deleted. This patch is some "unused" parts merged together because it doesn't make sense to split this much -- every chunk is independent of each other. > > > I would make that a separate patch. > > > > What are you referring to here? > > The enum change should be separate from the struct changes. > > > > > > > > > > > Delete those which aren't used. > > > > > > > > Delete some unused/unnecessary forward struct declarations for a change. > > > > > > This is a clean up, but should have a better change log. Just something > > > simple like: > > > > > > Delete unnecessary forward struct declarations. > > > > Alexey specializes in cute changelogs. > > eh Steven is right. That's what my literature teacher said in high school. > > I do have a concern about the patch: has it been tested with all > > possible Kconfigs? No. There may be some configs in which the forward > > declaration is required. > > > > And... I'm a bit surprised that forward declarations are allowed in C. > > A billion years ago I used a C compiler which would use 16 bits for > > an enum if the enumted values would fit in 16 bits. And it would use 32 > > bits otherwise. So the enumerated values were *required* for the > > compiler to be able to figure out the sizeof. But it was a billion > > years ago. > > Well, I only looked at the one change in ftrace.h which has a > "struct seq_file;" that is not used anywhere else in the file, so that > one definitely can go. It was tested on arm64 allmodconfig too. OK if this is concern, I could dust off my compile test farm.