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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB1A7C433EF for ; Thu, 23 Sep 2021 05:10:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D06AC61152 for ; Thu, 23 Sep 2021 05:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239174AbhIWFMI (ORCPT ); Thu, 23 Sep 2021 01:12:08 -0400 Received: from smtprelay0229.hostedemail.com ([216.40.44.229]:58002 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S234629AbhIWFMF (ORCPT ); Thu, 23 Sep 2021 01:12:05 -0400 Received: from omf08.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 3AB12182CED2A; Thu, 23 Sep 2021 05:10:31 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA id 8BA3C1A29FC; Thu, 23 Sep 2021 05:10:26 +0000 (UTC) Message-ID: Subject: Re: function prototype element ordering From: Joe Perches To: Linus Torvalds , Alexey Dobriyan Cc: Linux Kernel Mailing List , Andrew Morton , apw@canonical.com, Christoph Lameter , Daniel Micay , Dennis Zhou , dwaipayanray1@gmail.com, Joonsoo Kim , Linux-MM , Lukas Bulwahn , mm-commits@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Miguel Ojeda , Pekka Enberg , David Rientjes , Tejun Heo , Vlastimil Babka , "open list:DOCUMENTATION" Date: Wed, 22 Sep 2021 22:10:24 -0700 In-Reply-To: References: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> <20210910031046.G76dQvPhV%akpm@linux-foundation.org> <202109211630.2D00627@keescook> <202109211757.F38DF644@keescook> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: snz89n14ensws59qo6ginjubhwfa4zsc X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: 8BA3C1A29FC X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19xSpeXGi7fPZeju4RiHbCdzQS2uBIxyms= X-HE-Tag: 1632373826-787062 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-09-22 at 14:15 -0700, Linus Torvalds wrote: > On Wed, Sep 22, 2021 at 12:24 AM Alexey Dobriyan wrote: > > > > Attributes should be on their own line, they can be quite lengthy. > > No, no no. They really shouldn't. > > First off, no normal code should use that "__attribute__(())" syntax > anyway. It's ugly and big, and many of the attributes are > compiler-specific anyway. > > So the "quite lengthy" argument is bogus, because the actual names you > should use are things like "__packed" or "__pure" or "__user" etc. > > But the "on their own line" is complete garbage to begin with. That > will NEVER be a kernel rule. We should never have a rule that assumes > things are so long that they need to be on multiple lines. I think it's not so much that lines are long, it's more that the information provided by these markings aren't particularly useful to a caller/user of a function. Under what circumstance is a marking like __pure/__cold or __section useful to someone that just wants to call a particular function? A secondary reason why these should be separate or at least put at the begining of a function declaration is compatibility with existing tools like ctags. 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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00A1FC433EF for ; Thu, 23 Sep 2021 05:10:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5028261215 for ; Thu, 23 Sep 2021 05:10:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5028261215 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 6BE576B006C; Thu, 23 Sep 2021 01:10:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66D51900002; Thu, 23 Sep 2021 01:10:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E7056B0072; Thu, 23 Sep 2021 01:10:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0099.hostedemail.com [216.40.44.99]) by kanga.kvack.org (Postfix) with ESMTP id 3F5006B006C for ; Thu, 23 Sep 2021 01:10:32 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E06D32B379 for ; Thu, 23 Sep 2021 05:10:31 +0000 (UTC) X-FDA: 78617662662.40.A485E78 Received: from smtprelay.hostedemail.com (smtprelay0245.hostedemail.com [216.40.44.245]) by imf10.hostedemail.com (Postfix) with ESMTP id 8AC2E6001988 for ; Thu, 23 Sep 2021 05:10:31 +0000 (UTC) Received: from omf08.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 3AB12182CED2A; Thu, 23 Sep 2021 05:10:31 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf08.hostedemail.com (Postfix) with ESMTPA id 8BA3C1A29FC; Thu, 23 Sep 2021 05:10:26 +0000 (UTC) Message-ID: Subject: Re: function prototype element ordering From: Joe Perches To: Linus Torvalds , Alexey Dobriyan Cc: Linux Kernel Mailing List , Andrew Morton , apw@canonical.com, Christoph Lameter , Daniel Micay , Dennis Zhou , dwaipayanray1@gmail.com, Joonsoo Kim , Linux-MM , Lukas Bulwahn , mm-commits@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Miguel Ojeda , Pekka Enberg , David Rientjes , Tejun Heo , Vlastimil Babka , "open list:DOCUMENTATION" Date: Wed, 22 Sep 2021 22:10:24 -0700 In-Reply-To: References: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> <20210910031046.G76dQvPhV%akpm@linux-foundation.org> <202109211630.2D00627@keescook> <202109211757.F38DF644@keescook> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19xSpeXGi7fPZeju4RiHbCdzQS2uBIxyms= X-HE-Tag: 1632373826-787062 X-Stat-Signature: zo5bp9i5hw5aq1dcidyj3s5o33nyhm1x Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=none; spf=none (imf10.hostedemail.com: domain of joe@perches.com has no SPF policy when checking 216.40.44.245) smtp.mailfrom=joe@perches.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8AC2E6001988 X-HE-Tag: 1632373831-476795 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: On Wed, 2021-09-22 at 14:15 -0700, Linus Torvalds wrote: > On Wed, Sep 22, 2021 at 12:24 AM Alexey Dobriyan wrote: > > > > Attributes should be on their own line, they can be quite lengthy. > > No, no no. They really shouldn't. > > First off, no normal code should use that "__attribute__(())" syntax > anyway. It's ugly and big, and many of the attributes are > compiler-specific anyway. > > So the "quite lengthy" argument is bogus, because the actual names you > should use are things like "__packed" or "__pure" or "__user" etc. > > But the "on their own line" is complete garbage to begin with. That > will NEVER be a kernel rule. We should never have a rule that assumes > things are so long that they need to be on multiple lines. I think it's not so much that lines are long, it's more that the information provided by these markings aren't particularly useful to a caller/user of a function. Under what circumstance is a marking like __pure/__cold or __section useful to someone that just wants to call a particular function? A secondary reason why these should be separate or at least put at the begining of a function declaration is compatibility with existing tools like ctags.