linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Mickaël Salaün" <mic@digikod.net>
Cc: Miguel Ojeda <ojeda@kernel.org>,
	Andy Whitcroft <apw@canonical.com>,
	Brian Norris <briannorris@chromium.org>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Kees Cook <keescook@chromium.org>,
	Konstantin Meskhidze <konstantin.meskhidze@huawei.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Paul Moore <paul@paul-moore.com>, Tom Rix <trix@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev
Subject: Re: [PATCH v2 4/5] clang-format: Fix empty curly braces
Date: Fri, 20 May 2022 10:24:40 -0700	[thread overview]
Message-ID: <5be32ddf7688db38408466315a80e03e9af7ac40.camel@perches.com> (raw)
In-Reply-To: <CANiq72kbp3xTpj-L2BfLQ1Ecx-2Ki0W3e5YLERx8-T9bjb96=g@mail.gmail.com>

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@digikod.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




  reply	other threads:[~2022-05-20 17:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06 16:01 [PATCH v2 0/5] Fix clang-format configuration according to checkpatch.pl Mickaël Salaün
2022-05-06 16:01 ` [PATCH v2 1/5] clang-format: Update and extend the for_each list with tools/ Mickaël Salaün
2022-05-20 11:57   ` Miguel Ojeda
2022-05-06 16:01 ` [PATCH v2 2/5] clang-format: Update to clang-format >= 6 Mickaël Salaün
2022-05-06 16:01 ` [PATCH v2 3/5] clang-format: Fix goto labels indentation Mickaël Salaün
2022-05-20 17:07   ` Miguel Ojeda
2022-05-06 16:01 ` [PATCH v2 4/5] clang-format: Fix empty curly braces Mickaël Salaün
2022-05-20 17:15   ` Miguel Ojeda
2022-05-20 17:24     ` Joe Perches [this message]
2022-05-20 17:50       ` Miguel Ojeda
2022-05-20 18:00         ` Joe Perches
2022-05-20 18:57           ` Miguel Ojeda
2022-05-23 11:14     ` Mickaël Salaün
2022-05-06 16:01 ` [PATCH v2 5/5] clang-format: Fix space after for_each macros Mickaël Salaün
2022-05-11 15:40   ` Joe Perches
2022-05-11 17:34     ` Mickaël Salaün
2022-05-11 17:38       ` Joe Perches
2022-05-11 14:19 ` [PATCH v2 0/5] Fix clang-format configuration according to checkpatch.pl Mickaël Salaün
2022-05-11 15:29   ` Miguel Ojeda
2022-05-11 17:38     ` Brian Norris
2022-05-11 17:40     ` Mickaël Salaün
2022-05-20 19:11 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5be32ddf7688db38408466315a80e03e9af7ac40.camel@perches.com \
    --to=joe@perches.com \
    --cc=Jason@zx2c4.com \
    --cc=apw@canonical.com \
    --cc=briannorris@chromium.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=keescook@chromium.org \
    --cc=konstantin.meskhidze@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=lukas.bulwahn@gmail.com \
    --cc=mic@digikod.net \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=paul@paul-moore.com \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).