All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Deepa Dinamani <deepa.kernel@gmail.com>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Kees Cook <keescook@chromium.org>, Jann Horn <jannh@google.com>
Subject: Re: [PATCH] kernel/compat.c: mark expected switch fall-throughs
Date: Tue, 16 Apr 2019 10:32:55 +0200	[thread overview]
Message-ID: <CAK8P3a31Cp_COwjuOm6uG_23M3Ys4tJTB33jBENj-so0jkhgzg@mail.gmail.com> (raw)
In-Reply-To: <20190416172937.6a7621f7@canb.auug.org.au>

On Tue, Apr 16, 2019 at 9:29 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> In preparation to enabling -Wimplicit-fallthrough, mark switch cases
> where we are expecting to fall through.
>
> This patch aims to suppress up to 3 missing-break-in-switch false
> positives on some architectures.
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Gustavo A. R. Silva <gustavo@embeddedor.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Jann Horn <jannh@google.com>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Acked-by: Arnd Bergmann <arnd@arndb.de>

> ---
>  kernel/compat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> I know that this makes the lines longer than 80 characters, but I
> though that this was better than adding new lines.

It's a bit inconsistent though since put_compat_sigset() has the
comments in separate lines, as of commit 89976005536c
("include/linux/compat.h: mark expected switch fall-throughs").

I don't care either way, but it might be better to do it the same way
for both.

We could also consider just getting rid of put_compat_sigset() and
get_compat_sigset() but replacing them with a combined
put_sigset()/get_sigset() that does the right thing for both native
and compat tasks. This lets us kill a couple of compat system
calls that only differ in their sigset_t argument. On little-endian
systems (which are the vast majority of the installed base), there
is no difference anyway there is no overhead anyway since
native and compat sigset_t are identical.

        Arnd

  reply	other threads:[~2019-04-16  8:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  7:29 [PATCH] kernel/compat.c: mark expected switch fall-throughs Stephen Rothwell
2019-04-16  8:32 ` Arnd Bergmann [this message]
2019-04-16  8:53   ` Stephen Rothwell
2019-04-16  9:14     ` Arnd Bergmann
2019-05-15  5:23 Stephen Rothwell

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=CAK8P3a31Cp_COwjuOm6uG_23M3Ys4tJTB33jBENj-so0jkhgzg@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=deepa.kernel@gmail.com \
    --cc=gustavo@embeddedor.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.