Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp614460lqs; Thu, 13 Jun 2024 23:29:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUs6eNDf5mK8/a+QNKq1s2zHV4azHKohZCDmpUebD1+5dGUpq+RKCYFbRhGXg6sJCEvoUtpCXV++Y4BkrMRyg1zgOZg4wjIYv0XkMpGhQ== X-Google-Smtp-Source: AGHT+IG67fZkPWjo8cJr9UMISllqe18qaAega/BxL4KgV3uFxbCUrK1MxkTYfJzGy7p9V7DNZ7Ar X-Received: by 2002:ad4:5f4f:0:b0:6b0:91a4:eccb with SMTP id 6a1803df08f44-6b2afd6a446mr21662416d6.48.1718346588381; Thu, 13 Jun 2024 23:29:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718346588; cv=pass; d=google.com; s=arc-20160816; b=Q/Q/bD0/eW2fLg56pgZLh0dGSrpKR9xSd2h/yATC8SkxIb7EFEDAbxOc4F5Du86PZP EGVRRgpQO1kJPa6BFJ7fuB83ITue10xqyEUYvMsh3rvec3XaUEEeYFKpGnsqK0E7cy7o aysZsSCToBxmbKodhNStjreMH2ZTTJDI4RYPgLN+cVH5GpVpFlmw8M346Wxl8A8zAa16 lDCHxEvgaPV2HAFW51/neXqCKeuX3EQi6bDrQtySGs25IjQ8aGTdd6jTQdCv4BiCEpQq KbCOE7Ak/n8d+xzsvQS5cOdvvsq+dtJzBfhoKIl1vcoy7kEWI4W7bBR5v3seIDenGODH BAgg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Pn3XIo1FDmmSG/nyq3G2IvjJub61mr4heaF3EjMELcs=; fh=IHEQqvNRPKbDAneqfXwEgCqW2Wuu7j+nO0VYDepJBvM=; b=HHY+WHLa0Ai1ytdhEu9m/Km7bSN2RtGN0pZKwaVjRTEWcumIqHJe4RI+gisZdO0Gqv T7zXIdFA3qfx+CHUHwxBVaVGVqt0l1yF/IGHd2rk0WwNqNx7sRVEYG4Mtzh2HCAWmzam B/QPPtZY40XSl+j8ZPi/cEBd3Wo3n/ZuKliDd18VWgJdhaWhqKniqot7vasNSeSggTyk M7YFir56iKKGWWDyDyZxTQGGtxGYKRZamtPQRwXl+HUrDC0SI4kpNYWP+Kz1uRj8V/73 gbDVdY6SybWJmEuR+l9LPxgN6RQgrFhojRaicuMRxwMPZTuVchh+VeQxVowHU0fQ8voj ktBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RxacswBI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-214395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5b6793csi31584316d6.474.2024.06.13.23.29.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 23:29:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RxacswBI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-214395-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214395-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0BC931C21EB9 for ; Fri, 14 Jun 2024 06:29:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DE93A148309; Fri, 14 Jun 2024 06:29:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RxacswBI" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 651BE1EEE0; Fri, 14 Jun 2024 06:29:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718346579; cv=none; b=oz/X5nvp7K+S5s86WSlT6zmIh/3zWWjMo+PLR+IgjTcUfuBzS5V9S4fh2lGw6DoKsmib472UefnWRXHc7TQBKLngDNwnpN3SrRCLOXoz2uaTjE/ucNEIMGdEtfEXoWs2pSc4wg4QiV75AZ4i8qlGdAz1ULFlOQG325A7cMPKSwY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718346579; c=relaxed/simple; bh=SWv5Y3/Unba0KZDE/AlTebpmpXShx8eRF1ru3+9BvJM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HSliV7af/0yhioF150qdrXM1iKCecG2tAHbxeWQZqswD9hwQUOyMHHs/24eadFsLbdtyjlWEsRx31F5HMekPxxmNAdq8l2uRIcxCqildnk6yqMA4f7szOK8EQyTE/qDiYGoDyoh/w6garPgUAESAi8exFH2VBRRIYR55LzAsG0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RxacswBI; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-35f236a563cso1547229f8f.2; Thu, 13 Jun 2024 23:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718346576; x=1718951376; darn=vger.kernel.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=RxacswBIvmfmS7e0bPHrd8VFmnZT3kwalre4IQNQn1hkrbbNMKeCW7nxXw9O1rTLQU dZfS5/BVrMY0fBioQ50lfhZD77opcxvlIL+lrxZmzuzsd1oU1VvglWh15x0lm0J4n9eg W6zhK0z3CofcEAsRqhiVCFLUzZUFu0AZ6lQ5CW3VSOcdy2g6TiGWGnKCTtk/Y1aPdCZw whTv2+a+VGkgjmVR0qEj+exEQBGeDL61tI2wOYRyr87+yttYMRiM1R4xwxsATwyxo4i+ zY5+yeyD10t3MzgkgIqBRQfUx1BLYMX/gia//hzGyQCQuIzK3E/p3vvPdXP8jgnDhm91 uASg== 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=eMqImiIKyALigto9kBmfR7Y06QW288vgH3HHtXo1BrWTmNsPaurBEPEhjkeGCXj6W8 SHXOyzPAVJaVi+uVUEdgvEw/yqVz+6ePef+hY0INY0D2xwVpgI3B/cpDSC14eMbkHKC3 nnvUyIuP6xk78l9fZpFYxSNdeIQRn3MBZrijRckYz9c47SRqEBbPa+5qzLbq5zNixetP BVJEB+UTeivHTu50webpyC0q4fevstMPkZjJbGXTKJGZS00pRSy17Rd7QZUK5hqmYL7X t4/5x5sS8mzu3a4pj6oJOi0mBjSjVzNkO7WmlhTe2GVSRfuHguDkbVxR0aaatuH1CiHt 8/ng== X-Forwarded-Encrypted: i=1; AJvYcCV5fDu13r78/u+DHGaA+8nLeWs+tOhKfTYmGRPiV5g6oDmoV7uva+rfZ7l7lXMCyIuMHjR2Dq0PRhZd6kAo/9vQ13JV2Uz+f5NlD0gpY0biRPK81/jcXWIRJ6CqGercxKROAE3wkU6Ry1WWN+cYUEK1k6IvnzpY3V0n3w8vWYfepiJ6O3ljeo4oa3X2nIKXsPIYlR/Wdj7A X-Gm-Message-State: AOJu0YyP07gNjLV1toDBgyoDUj5DgL0aClr6uQpmPvU13UD6eln0zJCn 5ITuKwLfRe9CKXyQg2zkEMpGdjRwCWZhqM9y0uCpt/sJAbVyBqs= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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.