[PATCH 4/4] powerpc: Add -Wimplicit-fallthrough to arch CFLAGS

kbuild test robot lkp at intel.com
Thu Oct 11 04:00:11 AEDT 2018


Hi Michael,

I love your patch! Yet something to improve:

[auto build test ERROR on powerpc/next]
[also build test ERROR on v4.19-rc7 next-20181010]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Michael-Ellerman/powerpc-Move-core-kernel-logic-into-arch-powerpc-Kbuild/20181010-205834
base:   https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=powerpc 

All errors (new ones prefixed by >>):

   In file included from arch/powerpc/kernel/signal_32.c:32:0:
   include/linux/compat.h: In function 'put_compat_sigset':
>> include/linux/compat.h:494:51: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
                                             ~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compat.h:495:2: note: here
     case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
     ^~~~
   include/linux/compat.h:495:51: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
                                             ~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compat.h:496:2: note: here
     case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
     ^~~~
   include/linux/compat.h:496:51: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
                                             ~~~~~~~~~^~~~~~~~~~~~~
   include/linux/compat.h:497:2: note: here
     case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
     ^~~~
   cc1: all warnings being treated as errors
--
   arch/powerpc/kernel/nvram_64.c: In function 'dev_nvram_ioctl':
>> arch/powerpc/kernel/nvram_64.c:811:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
      printk(KERN_WARNING "nvram: Using obsolete PMAC_NVRAM_GET_OFFSET ioctl\n");
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/powerpc/kernel/nvram_64.c:812:2: note: here
     case IOC_NVRAM_GET_OFFSET: {
     ^~~~
   cc1: all warnings being treated as errors
--
   In file included from include/linux/kvm_host.h:14:0,
                    from arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:21:
   include/linux/signal.h: In function 'sigemptyset':
>> include/linux/signal.h:180:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
     case 2: set->sig[1] = 0;
             ~~~~~~~~~~~~^~~
   include/linux/signal.h:181:2: note: here
     case 1: set->sig[0] = 0;
     ^~~~
   cc1: all warnings being treated as errors
--
   arch/powerpc/platforms/powermac/feature.c: In function 'g5_i2s_enable':
>> arch/powerpc/platforms/powermac/feature.c:1477:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
      if (macio->type == macio_shasta)
         ^
   arch/powerpc/platforms/powermac/feature.c:1479:2: note: here
     default:
     ^~~~~~~
   cc1: all warnings being treated as errors
--
   arch/powerpc/xmon/xmon.c: In function 'do_spu_cmd':
>> arch/powerpc/xmon/xmon.c:4023:24: error: this statement may fall through [-Werror=implicit-fallthrough=]
      if (isxdigit(subcmd) || subcmd == '\n')
   arch/powerpc/xmon/xmon.c:4025:2: note: here
     case 'f':
     ^~~~
   cc1: all warnings being treated as errors

vim +494 include/linux/compat.h

fde9fc76 Matt Redfearn 2018-02-19  481  
fde9fc76 Matt Redfearn 2018-02-19  482  /*
fde9fc76 Matt Redfearn 2018-02-19  483   * Defined inline such that size can be compile time constant, which avoids
fde9fc76 Matt Redfearn 2018-02-19  484   * CONFIG_HARDENED_USERCOPY complaining about copies from task_struct
fde9fc76 Matt Redfearn 2018-02-19  485   */
fde9fc76 Matt Redfearn 2018-02-19  486  static inline int
fde9fc76 Matt Redfearn 2018-02-19  487  put_compat_sigset(compat_sigset_t __user *compat, const sigset_t *set,
fde9fc76 Matt Redfearn 2018-02-19  488  		  unsigned int size)
fde9fc76 Matt Redfearn 2018-02-19  489  {
fde9fc76 Matt Redfearn 2018-02-19  490  	/* size <= sizeof(compat_sigset_t) <= sizeof(sigset_t) */
fde9fc76 Matt Redfearn 2018-02-19  491  #ifdef __BIG_ENDIAN
fde9fc76 Matt Redfearn 2018-02-19  492  	compat_sigset_t v;
fde9fc76 Matt Redfearn 2018-02-19  493  	switch (_NSIG_WORDS) {
fde9fc76 Matt Redfearn 2018-02-19 @494  	case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3];
fde9fc76 Matt Redfearn 2018-02-19  495  	case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2];
fde9fc76 Matt Redfearn 2018-02-19  496  	case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1];
fde9fc76 Matt Redfearn 2018-02-19  497  	case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0];
fde9fc76 Matt Redfearn 2018-02-19  498  	}
fde9fc76 Matt Redfearn 2018-02-19  499  	return copy_to_user(compat, &v, size) ? -EFAULT : 0;
fde9fc76 Matt Redfearn 2018-02-19  500  #else
fde9fc76 Matt Redfearn 2018-02-19  501  	return copy_to_user(compat, set, size) ? -EFAULT : 0;
fde9fc76 Matt Redfearn 2018-02-19  502  #endif
fde9fc76 Matt Redfearn 2018-02-19  503  }
bebfa101 Andi Kleen    2006-06-26  504  

:::::: The code at line 494 was first introduced by commit
:::::: fde9fc766e96c494b82931b1d270a9a751be07c0 signals: Move put_compat_sigset to compat.h to silence hardened usercopy

:::::: TO: Matt Redfearn <matt.redfearn at mips.com>
:::::: CC: James Hogan <jhogan at kernel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 23972 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20181011/7342110b/attachment-0001.gz>


More information about the Linuxppc-dev mailing list