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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 33722C433EF for ; Wed, 22 Sep 2021 21:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1675060D42 for ; Wed, 22 Sep 2021 21:16:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237919AbhIVVRf (ORCPT ); Wed, 22 Sep 2021 17:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237904AbhIVVRY (ORCPT ); Wed, 22 Sep 2021 17:17:24 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C29CC061756 for ; Wed, 22 Sep 2021 14:15:54 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id g41so17318295lfv.1 for ; Wed, 22 Sep 2021 14:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7XJav0dfWNxK79pvtGX/UV/+fzNxl315YNj5Lb0kUtk=; b=QA/EzrWbAIrSwOaNV4uqMw33DYIddOpz6ZYLeSLgSw/6W5sXis/SfJPUXmmq3UhODG 6HTHGK+Pi7RNxhY6fHDq1cECQSdwskC8x9GDOcCAMch8XMogspIaioLO3jy91LAe9v+p zPQysb2+nkIu4xF1pvfTRTKDEaNJCficfXCxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7XJav0dfWNxK79pvtGX/UV/+fzNxl315YNj5Lb0kUtk=; b=B1VbZcGu9BrvZqXZvAlyS8r4I+zKTnwL5q5DcqmKe/w0K6Hr4A9Uz+CLEhvX0x6+/l q3pvgIFI20IGy1nedmq0/dt3kR1vHVuP90iiYILfa5sSJvGcttrft1ZaNYNeXaCeqtZe QcAVu0qj/HBYIc+vfUJz7wTy2E4JMLMbln7R6f/0xV1UUtxw+v5Q4/Kna/r3IV48HMc+ jtL0mxohs4PcMQO8b4RyVCy8WTzK48IYAF8CsyifT2K5pzjUa1lcqOGBAt0STflct+kL AyOH6BO9QDUk3YQLd5xaft40rStL1+moTzgNHS39yqKqvsLdP3rnw/eL0qHiJZ+gx/JI T6ZQ== X-Gm-Message-State: AOAM533W008PXDrV4g7c12IBo56LjITgEqc343PPgvBESrxqsJciTrAq AJuqTtT46fvEXi4Ej+ypL8p03nC3NnZDoDViBDU= X-Google-Smtp-Source: ABdhPJyAfkoKy9Pyo35CfgiRSxpUA+5EZLWTrlT1IXuQvUPWp3RJy2rtt96YC1XxZXy/JcfF+MO5AQ== X-Received: by 2002:a2e:8915:: with SMTP id d21mr1474028lji.45.1632345352248; Wed, 22 Sep 2021 14:15:52 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id s14sm369789ljh.38.2021.09.22.14.15.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Sep 2021 14:15:50 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id u8so16856927lff.9 for ; Wed, 22 Sep 2021 14:15:49 -0700 (PDT) X-Received: by 2002:a05:6512:12c4:: with SMTP id p4mr1044332lfg.280.1632345349597; Wed, 22 Sep 2021 14:15:49 -0700 (PDT) MIME-Version: 1.0 References: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> <20210910031046.G76dQvPhV%akpm@linux-foundation.org> <202109211630.2D00627@keescook> <202109211757.F38DF644@keescook> In-Reply-To: From: Linus Torvalds Date: Wed, 22 Sep 2021 14:15:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: function prototype element ordering To: Alexey Dobriyan Cc: Linux Kernel Mailing List , Joe Perches , 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. We don't put function return types on their own lines either, even if some other projects have that rule (just to get function names at the beginning of lines or some other odd reason). So no, attributes do not go on their own lines, and they also generally don't go before the thing they describe. Your examples are wrong, and explicitly against kernel rules. Linus 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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS 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 3D35FC433F5 for ; Wed, 22 Sep 2021 21:15:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AFBE160D42 for ; Wed, 22 Sep 2021 21:15:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AFBE160D42 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0D1F96B006C; Wed, 22 Sep 2021 17:15:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 08268900002; Wed, 22 Sep 2021 17:15:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EB2936B0072; Wed, 22 Sep 2021 17:15:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id DC4F36B006C for ; Wed, 22 Sep 2021 17:15:54 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8A39318028E75 for ; Wed, 22 Sep 2021 21:15:54 +0000 (UTC) X-FDA: 78616466628.10.C8D6177 Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by imf05.hostedemail.com (Postfix) with ESMTP id 3A77650600D9 for ; Wed, 22 Sep 2021 21:15:54 +0000 (UTC) Received: by mail-lf1-f54.google.com with SMTP id m3so17586470lfu.2 for ; Wed, 22 Sep 2021 14:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7XJav0dfWNxK79pvtGX/UV/+fzNxl315YNj5Lb0kUtk=; b=QA/EzrWbAIrSwOaNV4uqMw33DYIddOpz6ZYLeSLgSw/6W5sXis/SfJPUXmmq3UhODG 6HTHGK+Pi7RNxhY6fHDq1cECQSdwskC8x9GDOcCAMch8XMogspIaioLO3jy91LAe9v+p zPQysb2+nkIu4xF1pvfTRTKDEaNJCficfXCxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7XJav0dfWNxK79pvtGX/UV/+fzNxl315YNj5Lb0kUtk=; b=ZnZL8tE4QxhokMJLJ+jeinptYnQT7IPrmIt9enmJyT+mZMlG5vlL1fDUmm7yfGUrlT vQNnqOFuFnlXpn/+HzB9v44oNpoNOX/1XG7NKg3WotRF7dTEnXFSPFYhNFK9Aifay/G4 okO7a2YSBp5Ysov84eHz0aYicoLp9478D4tvqLSqjgN1kN86fcCIysyBrXpvw83q+5An tcBy32Kh5ukbJkSjK/UvNgZYr8A1ZWtHxutL1/oLNrRwHdS1fDZghQybFWv7lqfa5MJv Ah/KC4AY0EJTI42tKMVHBpvgBQZXaPHDlF9NtHK83o3ZuCRv7PedRjxVdoDES5oAbHtN ANqw== X-Gm-Message-State: AOAM531Z0Bj3o9ekwdiWJxs57uGRpKsbhQEJ/FVn4RePHT03FLRSgwLZ 7vXKeJyG+X8DVpuntZgCCHH56OQZ3LdEv/jPYbo= X-Google-Smtp-Source: ABdhPJyum0+50/ji+fjK0SUerzNtg+ohqgn7PnLlbii9Sp0X08vZrk+bgitdkNGYs4qi416gm/xoAw== X-Received: by 2002:a05:6512:3a88:: with SMTP id q8mr950771lfu.425.1632345352407; Wed, 22 Sep 2021 14:15:52 -0700 (PDT) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id f13sm265430lfr.185.2021.09.22.14.15.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Sep 2021 14:15:50 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id u18so16831598lfd.12 for ; Wed, 22 Sep 2021 14:15:49 -0700 (PDT) X-Received: by 2002:a05:6512:12c4:: with SMTP id p4mr1044332lfg.280.1632345349597; Wed, 22 Sep 2021 14:15:49 -0700 (PDT) MIME-Version: 1.0 References: <20210909200948.090d4e213ca34b5ad1325a7e@linux-foundation.org> <20210910031046.G76dQvPhV%akpm@linux-foundation.org> <202109211630.2D00627@keescook> <202109211757.F38DF644@keescook> In-Reply-To: From: Linus Torvalds Date: Wed, 22 Sep 2021 14:15:33 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: function prototype element ordering To: Alexey Dobriyan Cc: Linux Kernel Mailing List , Joe Perches , 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" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3A77650600D9 X-Stat-Signature: b1mbsg54pbctd3ypemi545gbxgf794m4 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b="QA/EzrWb"; spf=pass (imf05.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.54 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-HE-Tag: 1632345354-991271 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, 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. We don't put function return types on their own lines either, even if some other projects have that rule (just to get function names at the beginning of lines or some other odd reason). So no, attributes do not go on their own lines, and they also generally don't go before the thing they describe. Your examples are wrong, and explicitly against kernel rules. Linus