lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72nSQyAxK7JF62CgQEERg3XhxsECWj-E14HU8fwZ8U0ROg@mail.gmail.com>
Date:   Thu, 7 Jun 2018 14:50:24 +0200
From:   Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To:     Jason Gunthorpe <jgg@...lanox.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Andy Whitcroft <apw@...onical.com>,
        Joe Perches <joe@...ches.com>,
        Jonathan Corbet <corbet@....net>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] clang-format: Set IndentWrappedFunctionNames false

On Wed, Jun 6, 2018 at 10:15 PM, Jason Gunthorpe <jgg@...lanox.com> wrote:
> The true option causes this indenting for functions:
>
> static struct something_very_very_long *
>     function(void *arg)
> {
>
> While a quick survey suggests that the usual Linux fallback is the GNU
> style:
>
> static struct something_very_very_long *
> function(void *arg)
> {
>
> Eg as seen in:
>
>  kernel/cpu.c
>  kernel/fork.c
>
> and other places.
>
> Signed-off-by: Jason Gunthorpe <jgg@...lanox.com>
> ---
>  .clang-format | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Thanks for making this Miguel!

You're welcome! It is great to see people already using it. :-)

>
> I've been using clang-format for years with the kernel and noticed it
> was performing just a little different than I would have expected.
>
> AFAIK the above describes the more common choice in the code base?

Could be -- I took a look at several places and to the official
guidelines; but I am sure I may have missed some things :-) For some
options where I was unsure, I ran it through several "popular"/common
folders and see which one generated a smaller git diff -- maybe you
can try that and see what you get (also, it would be great if you can
try some others outside kernel/*).

>
> Not sure who's tree this is supposed to go through.. Andrew I guess?

It went through Andre the first time. In any case, I think it is fine
to send it through any one.

Cheers,
Miguel

>
> diff --git a/.clang-format b/.clang-format
> index faffc0d5af4eeb..1d5da22e0ba50c 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -382,7 +382,7 @@ IncludeIsMainRegex: '(Test)?$'
>  IndentCaseLabels: false
>  #IndentPPDirectives: None # Unknown to clang-format-5.0
>  IndentWidth: 8
> -IndentWrappedFunctionNames: true
> +IndentWrappedFunctionNames: false
>  JavaScriptQuotes: Leave
>  JavaScriptWrapImports: true
>  KeepEmptyLinesAtTheStartOfBlocks: false
> --
> 2.17.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ