From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A5B4C129; Tue, 10 Oct 2023 06:57:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zzQU1pwc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C42CCC433C8; Tue, 10 Oct 2023 06:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696921079; bh=EYuUNIt6jJRwYBy0E3p0Vk5Y1cHFfh6ehg6kHTfAyUU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=zzQU1pwcQ/CneY+FW5FxMonJkZiI86OeSlFhEhdRj/hvvySkkTG2K8Sk51p8M1RuX NA8xXufVqn3K4h0T1GP7rVOn7ryC3K4n6YeVOhjVhWQYEIJa6ayQXO2ZChu8j2BCF+ i7dawBqEH7KL0R9NbBls/UV6Yg3YejnrOELbQ5Mk= Date: Tue, 10 Oct 2023 08:57:55 +0200 From: Greg Kroah-Hartman To: Joe Perches Cc: Max Kellermann , Guenter Roeck , Jens Axboe , "Rafael J. Wysocki" , Borislav Petkov , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Jean Delvare , Jason Gunthorpe , Leon Romanovsky , Bart Van Assche , Joerg Roedel , Will Deacon , Robin Murphy , Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , Keith Busch , Christoph Hellwig , Sagi Grimberg , Alessandro Zummo , Alexandre Belloni , Jiri Slaby , Suzuki K Poulose , Mike Leach , James Clark , Leo Yan , Thomas Gleixner , Peter Zijlstra , Pavel Machek , Lee Jones , Arnd Bergmann , Bjorn Helgaas , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Sebastian Reichel , Krzysztof Kozlowski , Wim Van Sebroeck , "James E.J. Bottomley" , "Martin K. Petersen" , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, nvdimm@lists.linux.dev, linux-nvme@lists.infradead.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-leds@vger.kernel.org, linux-pci@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: [PATCH 6/7] fs/sysfs/group: make attribute_group pointers const Message-ID: <2023101041-giggle-refried-5b8c@gregkh> References: <20231009165741.746184-1-max.kellermann@ionos.com> <20231009165741.746184-6-max.kellermann@ionos.com> <264fa39d-aed6-4a54-a085-107997078f8d@roeck-us.net> Precedence: bulk X-Mailing-List: linux-perf-users@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: On Mon, Oct 09, 2023 at 11:48:10PM -0700, Joe Perches wrote: > On Mon, 2023-10-09 at 22:05 +0200, Max Kellermann wrote: > > On Mon, Oct 9, 2023 at 7:24 PM Guenter Roeck wrote: > > > Also, I don't know why checkpatch is happy with all the > > > > > > const struct attribute_group *const*groups; > > > > > > instead of > > > > > > const struct attribute_group *const *groups; > > > > I found out that checkpatch has no check for this at all; it does > > complain about such lines, but only for local variables. But that > > warning is actually a bug, because this is a check for unary > > operators: it thinks the asterisk is a dereference operator, not a > > pointer declaration, and complains that the unary operator must be > > preceded by a space. Thus warnings on local variable are only correct > > by coincidence, not by design. > > > > Inside structs or parameters (where my coding style violations can be > > found), it's a different context and thus checkpatch doesn't apply the > > rules for unary operators. > > My opinion is that const use in the kernel should almost > always have whitespace before and after it except when > preceded by a open parenthesis or a newline. I totally agree.