* Re: New linux-next KCFLAGS [not found] <CAGXu5jL9WDRVCzPP0V2cvFHWfwAfd74kBNX9O+0frFkD26ti1Q@mail.gmail.com> @ 2018-11-25 21:48 ` Stephen Rothwell 2018-11-26 5:46 ` Kees Cook 0 siblings, 1 reply; 6+ messages in thread From: Stephen Rothwell @ 2018-11-25 21:48 UTC (permalink / raw) To: Kees Cook; +Cc: PowerPC [-- Attachment #1: Type: text/plain, Size: 3785 bytes --] Hi Kees, On Fri, 26 Oct 2018 01:34:33 +0100 Kees Cook <keescook@google.com> wrote: > > So, if you it's possible to "seed" some new flags for linux-next, I'd > be interested in making sure no new instances of warnings from > -Wimplicit-fallthrough (gcc 7.1 and later) appear. VLAs will be gone > in a couple days, so I'm currently only interested in killing implicit > fallthroughs[1] now. There are hundreds of cases remaining, so ignore > those on the first build, but anything NEW is what I'd like to get > maintainer nags sent for (CCing myself and Gustavo Silva would be > especially nice, too). I don't know Gustavo's email address ... > Thanks! > > [1] Gustavo has fixed lots of actual bugs as part of this work: > https://lkml.kernel.org/r/1f64449a-ef19-20c8-f8cb-7e629f8fe71b@embeddedor.com I finally got around to this. I have added the following patch to my fixes tree (which is merged immediately after Linus' tree). commit 4d8360ade996cf1823e570544791c9d7bd660ffb Author: Stephen Rothwell <sfr@canb.auug.org.au> Date: Mon Nov 26 07:58:34 2018 +1100 Check for new cases of implict fallthrough for Kees Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> diff --git a/Makefile b/Makefile index ddbf627cad8f..380164f590bc 100644 --- a/Makefile +++ b/Makefile @@ -804,6 +804,9 @@ KBUILD_CFLAGS += -Wdeclaration-after-statement # Variable Length Arrays (VLAs) should not be used anywhere in the kernel KBUILD_CFLAGS += $(call cc-option,-Wvla) +# Check for implict fallthroughs +KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough) + # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += -Wno-pointer-sign Unfortunately, some of the kernel is built with -Werror, so I have had to add the following patch as well just to build Linus' tree: (I just marked them as "fall through", I am not sure if that is the correct resolution.) From: Stephen Rothwell <sfr@canb.auug.org.au> Date: Mon, 26 Nov 2018 08:32:39 +1100 Subject: [PATCH] powerpc: tag implicit fall throughs Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> --- arch/powerpc/kernel/nvram_64.c | 1 + arch/powerpc/platforms/powermac/feature.c | 1 + arch/powerpc/xmon/xmon.c | 1 + 3 files changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 22e9d281324d..06e2eda2430e 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -809,6 +809,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd, #ifdef CONFIG_PPC_PMAC case OBSOLETE_PMAC_NVRAM_GET_OFFSET: printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n"); + /* fall through */ case IOC_NVRAM_GET_OFFSET: { int part, offset; diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index ed2f54b3f173..a7ec06876b53 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c @@ -1471,6 +1471,7 @@ static long g5_i2s_enable(struct device_node *node, long param, long value) case 2: if (macio->type == macio_shasta) break; + /* fall through */ default: return -ENODEV; } diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 36b8dc47a3c3..308326f8b7ed 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -4033,6 +4033,7 @@ static int do_spu_cmd(void) subcmd = inchar(); if (isxdigit(subcmd) || subcmd == '\n') termch = subcmd; + /* fall through */ case 'f': scanhex(&num); if (num >= XMON_NUM_SPUS || !spu_info[num].spu) { -- 2.19.1 -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: New linux-next KCFLAGS 2018-11-25 21:48 ` New linux-next KCFLAGS Stephen Rothwell @ 2018-11-26 5:46 ` Kees Cook 2018-11-26 6:49 ` Stephen Rothwell 0 siblings, 1 reply; 6+ messages in thread From: Kees Cook @ 2018-11-26 5:46 UTC (permalink / raw) To: Stephen Rothwell; +Cc: Gustavo A. R. Silva, PowerPC On Sun, Nov 25, 2018 at 1:48 PM Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > Hi Kees, > > On Fri, 26 Oct 2018 01:34:33 +0100 Kees Cook <keescook@google.com> wrote: > > > > So, if you it's possible to "seed" some new flags for linux-next, I'd > > be interested in making sure no new instances of warnings from > > -Wimplicit-fallthrough (gcc 7.1 and later) appear. VLAs will be gone > > in a couple days, so I'm currently only interested in killing implicit > > fallthroughs[1] now. There are hundreds of cases remaining, so ignore > > those on the first build, but anything NEW is what I'd like to get > > maintainer nags sent for (CCing myself and Gustavo Silva would be > > especially nice, too). > > I don't know Gustavo's email address ... > > > Thanks! > > > > [1] Gustavo has fixed lots of actual bugs as part of this work: > > https://lkml.kernel.org/r/1f64449a-ef19-20c8-f8cb-7e629f8fe71b@embeddedor.com > > I finally got around to this. I have added the following patch to my > fixes tree (which is merged immediately after Linus' tree). Excellent! (Though, wait, does this mean everyone _else_ will see this too? I'm worried that will be way too noisy...) > FYI, I am currently ignoring 659 such warnings in Linus' tree ... That sound about right. Before Gustavo started there maybe 1000 more. (!) :) Thanks! -Kees > commit 4d8360ade996cf1823e570544791c9d7bd660ffb > Author: Stephen Rothwell <sfr@canb.auug.org.au> > Date: Mon Nov 26 07:58:34 2018 +1100 > > Check for new cases of implict fallthrough > > for Kees > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> > > diff --git a/Makefile b/Makefile > index ddbf627cad8f..380164f590bc 100644 > --- a/Makefile > +++ b/Makefile > @@ -804,6 +804,9 @@ KBUILD_CFLAGS += -Wdeclaration-after-statement > # Variable Length Arrays (VLAs) should not be used anywhere in the kernel > KBUILD_CFLAGS += $(call cc-option,-Wvla) > > +# Check for implict fallthroughs > +KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough) > + > # disable pointer signed / unsigned warnings in gcc 4.0 > KBUILD_CFLAGS += -Wno-pointer-sign > > > Unfortunately, some of the kernel is built with -Werror, so I have had > to add the following patch as well just to build Linus' tree: > > (I just marked them as "fall through", I am not sure if that is the > correct resolution.) > > From: Stephen Rothwell <sfr@canb.auug.org.au> > Date: Mon, 26 Nov 2018 08:32:39 +1100 > Subject: [PATCH] powerpc: tag implicit fall throughs > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> > --- > arch/powerpc/kernel/nvram_64.c | 1 + > arch/powerpc/platforms/powermac/feature.c | 1 + > arch/powerpc/xmon/xmon.c | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c > index 22e9d281324d..06e2eda2430e 100644 > --- a/arch/powerpc/kernel/nvram_64.c > +++ b/arch/powerpc/kernel/nvram_64.c > @@ -809,6 +809,7 @@ static long dev_nvram_ioctl(struct file *file, unsigned int cmd, > #ifdef CONFIG_PPC_PMAC > case OBSOLETE_PMAC_NVRAM_GET_OFFSET: > printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n"); > + /* fall through */ > case IOC_NVRAM_GET_OFFSET: { > int part, offset; > > diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c > index ed2f54b3f173..a7ec06876b53 100644 > --- a/arch/powerpc/platforms/powermac/feature.c > +++ b/arch/powerpc/platforms/powermac/feature.c > @@ -1471,6 +1471,7 @@ static long g5_i2s_enable(struct device_node *node, long param, long value) > case 2: > if (macio->type == macio_shasta) > break; > + /* fall through */ > default: > return -ENODEV; > } > diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c > index 36b8dc47a3c3..308326f8b7ed 100644 > --- a/arch/powerpc/xmon/xmon.c > +++ b/arch/powerpc/xmon/xmon.c > @@ -4033,6 +4033,7 @@ static int do_spu_cmd(void) > subcmd = inchar(); > if (isxdigit(subcmd) || subcmd == '\n') > termch = subcmd; > + /* fall through */ > case 'f': > scanhex(&num); > if (num >= XMON_NUM_SPUS || !spu_info[num].spu) { > -- > 2.19.1 > > -- > Cheers, > Stephen Rothwell -- Kees Cook ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New linux-next KCFLAGS 2018-11-26 5:46 ` Kees Cook @ 2018-11-26 6:49 ` Stephen Rothwell 2018-11-26 6:56 ` Stephen Rothwell 2018-11-26 14:00 ` Stephen Rothwell 0 siblings, 2 replies; 6+ messages in thread From: Stephen Rothwell @ 2018-11-26 6:49 UTC (permalink / raw) To: Kees Cook; +Cc: Gustavo A. R. Silva, PowerPC [-- Attachment #1: Type: text/plain, Size: 372 bytes --] Hi Kees, On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook <keescook@google.com> wrote: > > Excellent! (Though, wait, does this mean everyone _else_ will see this > too? I'm worried that will be way too noisy...) Ah, yes, you may be right. everyone will see them :-( I may have to figure out another way to do this for tomorrow. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New linux-next KCFLAGS 2018-11-26 6:49 ` Stephen Rothwell @ 2018-11-26 6:56 ` Stephen Rothwell 2018-11-26 14:00 ` Stephen Rothwell 1 sibling, 0 replies; 6+ messages in thread From: Stephen Rothwell @ 2018-11-26 6:56 UTC (permalink / raw) To: Kees Cook; +Cc: Gustavo A. R. Silva, PowerPC [-- Attachment #1: Type: text/plain, Size: 629 bytes --] Hi Kees, On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook <keescook@google.com> wrote: > > > > Excellent! (Though, wait, does this mean everyone _else_ will see this > > too? I'm worried that will be way too noisy...) > > Ah, yes, you may be right. everyone will see them :-( > > I may have to figure out another way to do this for tomorrow. For today, I will just revert the commit that adds the flag at the end or my merging run. People will only see the warnings if they are bisecting. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New linux-next KCFLAGS 2018-11-26 6:49 ` Stephen Rothwell 2018-11-26 6:56 ` Stephen Rothwell @ 2018-11-26 14:00 ` Stephen Rothwell 2018-11-26 14:25 ` Gustavo A. R. Silva 1 sibling, 1 reply; 6+ messages in thread From: Stephen Rothwell @ 2018-11-26 14:00 UTC (permalink / raw) To: Kees Cook; +Cc: Gustavo A. R. Silva, PowerPC [-- Attachment #1: Type: text/plain, Size: 589 bytes --] Hi all, On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: > > On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook <keescook@google.com> wrote: > > > > Excellent! (Though, wait, does this mean everyone _else_ will see this > > too? I'm worried that will be way too noisy...) > > Ah, yes, you may be right. everyone will see them :-( > > I may have to figure out another way to do this for tomorrow. OK, starting tomorrow (later today), I have just added -Wimplicit-fallthrough to KCFLAGS in my build scripts. -- Cheers, Stephen Rothwell [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: New linux-next KCFLAGS 2018-11-26 14:00 ` Stephen Rothwell @ 2018-11-26 14:25 ` Gustavo A. R. Silva 0 siblings, 0 replies; 6+ messages in thread From: Gustavo A. R. Silva @ 2018-11-26 14:25 UTC (permalink / raw) To: Stephen Rothwell, Kees Cook; +Cc: PowerPC On 11/26/18 8:00 AM, Stephen Rothwell wrote: > Hi all, > > On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote: >> >> On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook <keescook@google.com> wrote: >>> >>> Excellent! (Though, wait, does this mean everyone _else_ will see this >>> too? I'm worried that will be way too noisy...) >> >> Ah, yes, you may be right. everyone will see them :-( >> >> I may have to figure out another way to do this for tomorrow. > > OK, starting tomorrow (later today), I have just added > -Wimplicit-fallthrough to KCFLAGS in my build scripts. > Awesome! Thank you, Stephen. :) -- Gustavo ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-11-26 14:49 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <CAGXu5jL9WDRVCzPP0V2cvFHWfwAfd74kBNX9O+0frFkD26ti1Q@mail.gmail.com> 2018-11-25 21:48 ` New linux-next KCFLAGS Stephen Rothwell 2018-11-26 5:46 ` Kees Cook 2018-11-26 6:49 ` Stephen Rothwell 2018-11-26 6:56 ` Stephen Rothwell 2018-11-26 14:00 ` Stephen Rothwell 2018-11-26 14:25 ` Gustavo A. R. Silva
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).