Re: New linux-next KCFLAGS

2018-11-26 Thread Gustavo A. R. Silva




On 11/26/18 8:00 AM, Stephen Rothwell wrote:

Hi all,

On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell  
wrote:


On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook  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


Re: New linux-next KCFLAGS

2018-11-26 Thread Stephen Rothwell
Hi all,

On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell  
wrote:
>
> On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook  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


pgp6DnytlpIpB.pgp
Description: OpenPGP digital signature


Re: New linux-next KCFLAGS

2018-11-25 Thread Stephen Rothwell
Hi Kees,

On Mon, 26 Nov 2018 17:49:26 +1100 Stephen Rothwell  
wrote:
>
> On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook  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


pgpDhGtmo42eP.pgp
Description: OpenPGP digital signature


Re: New linux-next KCFLAGS

2018-11-25 Thread Stephen Rothwell
Hi Kees,

On Sun, 25 Nov 2018 21:46:20 -0800 Kees Cook  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


pgpx9uB0c_GW8.pgp
Description: OpenPGP digital signature


Re: New linux-next KCFLAGS

2018-11-25 Thread Stephen Rothwell
Hi Kees,

On Fri, 26 Oct 2018 01:34:33 +0100 Kees Cook  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-7e629f8fe...@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 
Date:   Mon Nov 26 07:58:34 2018 +1100

Check for new cases of implict fallthrough

for Kees

Signed-off-by: Stephen Rothwell 

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 
Date: Mon, 26 Nov 2018 08:32:39 +1100
Subject: [PATCH] powerpc: tag implicit fall throughs

Signed-off-by: Stephen Rothwell 
---
 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();
if (num >= XMON_NUM_SPUS || !spu_info[num].spu) {
-- 
2.19.1

-- 
Cheers,
Stephen Rothwell


pgp_Rj189MfEj.pgp
Description: OpenPGP digital signature