[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a31Cp_COwjuOm6uG_23M3Ys4tJTB33jBENj-so0jkhgzg@mail.gmail.com>
Date: Tue, 16 Apr 2019 10:32:55 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Stephen Rothwell <sfr@...b.auug.org.au>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Deepa Dinamani <deepa.kernel@...il.com>,
"Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Kees Cook <keescook@...omium.org>, Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH] kernel/compat.c: mark expected switch fall-throughs
On Tue, Apr 16, 2019 at 9:29 AM Stephen Rothwell <sfr@...b.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@...db.de>
> Cc: Deepa Dinamani <deepa.kernel@...il.com>
> Cc: Gustavo A. R. Silva <gustavo@...eddedor.com>
> Cc: Kees Cook <keescook@...omium.org>
> Cc: Jann Horn <jannh@...gle.com>
> Signed-off-by: Stephen Rothwell <sfr@...b.auug.org.au>
Acked-by: Arnd Bergmann <arnd@...db.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
Powered by blists - more mailing lists