[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5be32ddf7688db38408466315a80e03e9af7ac40.camel@perches.com>
Date: Fri, 20 May 2022 10:24:40 -0700
From: Joe Perches <joe@...ches.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>,
Mickaël Salaün <mic@...ikod.net>
Cc: Miguel Ojeda <ojeda@...nel.org>,
Andy Whitcroft <apw@...onical.com>,
Brian Norris <briannorris@...omium.org>,
Dwaipayan Ray <dwaipayanray1@...il.com>,
"Jason A . Donenfeld" <Jason@...c4.com>,
Kees Cook <keescook@...omium.org>,
Konstantin Meskhidze <konstantin.meskhidze@...wei.com>,
Lukas Bulwahn <lukas.bulwahn@...il.com>,
Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Paul Moore <paul@...l-moore.com>, Tom Rix <trix@...hat.com>,
linux-kernel <linux-kernel@...r.kernel.org>, llvm@...ts.linux.dev
Subject: Re: [PATCH v2 4/5] clang-format: Fix empty curly braces
On Fri, 2022-05-20 at 19:15 +0200, Miguel Ojeda wrote:
> On Fri, May 6, 2022 at 6:00 PM Mickaël Salaün <mic@...ikod.net> wrote:
> >
> > SplitEmptyFunction [1] should be false to not add a new line in an empty
> > function body. This follows the current kernel coding style.
>
> I don't think this is correct. Checking headers in `include/linux/`, I
> see ~70 using {} (when not in the same line as the signature), and
> ~700 in different lines. In `kernel/`, it is even more pronounced: 4
> vs. ~200.
>
> Am I missing something?
historic vs recent uses ?
I think it's mostly a 'don't care' style.
It's not like there's a significant line count advantage.
Sometimes there is though for blocks like
#if CONFIG_FOO
void foo1(...);
void foo2(...);
...
void fooN(...);
#else
static inline void foo1(...) {}
static inline void foo2(...) {}
...
static inline void fooN(...) {}
#endif
Powered by blists - more mailing lists