Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2327474rdb; Mon, 9 Oct 2023 23:49:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1pyIScFnqzvUjr+MA2vJcmNOE5SkRf2raIm8UIewVJh0KgEODTgGGIP5y1/7ZKaMSFTlq X-Received: by 2002:a05:6830:22e6:b0:6bc:fdc8:d600 with SMTP id t6-20020a05683022e600b006bcfdc8d600mr18498814otc.25.1696920549961; Mon, 09 Oct 2023 23:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696920549; cv=none; d=google.com; s=arc-20160816; b=tVbq6VTio80eL9PHIjPd8DCeqO5aOwy1VIV/FQ4HEcD85zpnnjYyUIIU6Qp2CqJFq+ intG5OHM0MstUvBw379h1CX/IFfjpyw5FXykKCw+gXouLSyQKrVY6c6nIBOnXqVSUBug LS5vy/eCsMPJk9G9bCMnygbPj23v0spBaDhER0sxLZEf4bkTGdWsGZqh9arkycYmOczI JtD2lHABmaQZ2OVfdWPn0KjzXlLQY+eGVA8XTaTuoSbXJySz6qmXxRDQBytn4ZmQEGgO 5Tn1BOC1bpE+kqAM/7GU1e1Vxok7Kv7hdCWJYPIK4CesYn1bN+FKbXX359CeC00oiwgC 2UQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=zLomNE57+lg3RMzJWBkISElbyPp+r35vF7xVkRMD8lY=; fh=KLKgqIbyTSkNPL81IpJev5FG0Kz0Qw/Fr9suTpOKN+g=; b=tF8xxAQIecAsSF+yOjz6h5wfv+MFURRYnj3cS86pSUeh34rWUI+VFs2feFjMTudUcj oaR02JHAxV4W/jhN3qRKyq0ojusoK+1rqC+VJ2ATTH+hMd0L2E5Iu37eXEr1aMT70Odj SXqzYsF9j3mhaQoMNyURIGXOIOptd790kCzl1Y5Fc2Ah8Z6MkQkb5JkLnkVKbMhuuqm/ HuY2B83yQqQ9hQ808sR+flZPeALschVK5j3PBWTrS/cmljNiKxoSkBaKfVxZ5+YOORy9 NDWpmoHmxCJmmhBk4JztRsTTHehWT51xrHQnScyl+KXfdetnQF9WaqU19oJawl0Awv2w QzKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x10-20020a634a0a000000b0057745b2d018si10777331pga.390.2023.10.09.23.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 23:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CC76C80C3A3F; Mon, 9 Oct 2023 23:49:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442303AbjJJGsv convert rfc822-to-8bit (ORCPT + 99 others); Tue, 10 Oct 2023 02:48:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442295AbjJJGst (ORCPT ); Tue, 10 Oct 2023 02:48:49 -0400 Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7060A97 for ; Mon, 9 Oct 2023 23:48:41 -0700 (PDT) Received: from omf06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9C649140199; Tue, 10 Oct 2023 06:48:39 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA id 379272000F; Tue, 10 Oct 2023 06:48:11 +0000 (UTC) Message-ID: Subject: Re: [PATCH 6/7] fs/sysfs/group: make attribute_group pointers const From: Joe Perches To: Max Kellermann , Guenter Roeck Cc: Jens Axboe , Greg Kroah-Hartman , "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 Date: Mon, 09 Oct 2023 23:48:10 -0700 In-Reply-To: References: <20231009165741.746184-1-max.kellermann@ionos.com> <20231009165741.746184-6-max.kellermann@ionos.com> <264fa39d-aed6-4a54-a085-107997078f8d@roeck-us.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Stat-Signature: x66gji9pr8zwbank5ef871m9qoojjjfr X-Rspamd-Server: rspamout04 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Rspamd-Queue-Id: 379272000F X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19bm9nHqj2XrX3TKwatvC/C1GajNvD5h9I= X-HE-Tag: 1696920491-749924 X-HE-Meta: U2FsdGVkX1/+029EmPc9sKVNFK2VRUjBCte/A2E+5y43hxFCP+MAKFoIxkcikfn6Jucu52vLqnvIqQDvdm6WvqlwnI8PH42O3yPwjrf6/Rk44z8SFUR40tWN1QdYZq3HPOEvKn0PLMPTqRRMr7zlpFwkMW85ySQYIyr+J8E4OP6W/LoiP3zYhR+0cmnV5ToftIwEMltweE+g/zUx+NL1fSjTbqk3Sf4w33VMSw7k9oncskJ8CUN/bQZEOiHhpNbgGpLqoQJ7ob3InQymsj8a//o/6ldtQbuoxFCk/RnYuGfC0EahOFEMbfIs5+kJ0g+hK4chvkcdMx/L2QmQgmCvPhqiadvx8BYdkeJ2IpCV5Y5g+W85x67f7ON0uqOVXWab X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 09 Oct 2023 23:49:07 -0700 (PDT) X-Spam-Level: ** 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. $ git grep -wh const -- '*.[ch]' | \ grep -oP "[ \*\(]?const[ \*]?" | \ sort | uniq -c | sort -rn 222438 const 83386 const 51667 (const 2766 *const 834 const 442 const 343 const* 88 *const 37 (const 4 *const*