Re: [PATCH] kbuild: Enable -Wimplicit-fallthrough for clang 14.0.0+

From: kernel test robot
Date: Tue Aug 17 2021 - 00:16:20 EST


Hi Nathan,

I love your patch! Perhaps something to improve:

[auto build test WARNING on a2824f19e6065a0d3735acd9fe7155b104e7edf5]

url: https://github.com/0day-ci/linux/commits/Nathan-Chancellor/kbuild-Enable-Wimplicit-fallthrough-for-clang-14-0-0/20210817-085926
base: a2824f19e6065a0d3735acd9fe7155b104e7edf5
config: mips-randconfig-r003-20210816 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 2c6448cdc2f68f8c28fd0bd9404182b81306e6e6)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://github.com/0day-ci/linux/commit/358205a0573f713b532173c9cf3c9efa052dc9d0
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Nathan-Chancellor/kbuild-Enable-Wimplicit-fallthrough-for-clang-14-0-0/20210817-085926
git checkout 358205a0573f713b532173c9cf3c9efa052dc9d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

sound/core/pcm_native.c:273:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
struct snd_mask old_mask;
^
sound/core/pcm_native.c:309:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
struct snd_interval old_interval;
^
sound/core/pcm_native.c:350:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
struct snd_interval old_interval;
^
sound/core/pcm_native.c:349:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
struct snd_mask old_mask;
^
sound/core/pcm_native.c:633:18: warning: variable 'old_mask' set but not used [-Wunused-but-set-variable]
struct snd_mask old_mask;
^
sound/core/pcm_native.c:634:22: warning: variable 'old_interval' set but not used [-Wunused-but-set-variable]
struct snd_interval old_interval;
^
>> sound/core/pcm_native.c:3815:3: warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
fallthrough;
^
include/linux/compiler_attributes.h:210:41: note: expanded from macro 'fallthrough'
# define fallthrough __attribute__((__fallthrough__))
^
sound/core/pcm_native.c:3823:3: warning: fallthrough annotation in unreachable code [-Wimplicit-fallthrough]
fallthrough;
^
include/linux/compiler_attributes.h:210:41: note: expanded from macro 'fallthrough'
# define fallthrough __attribute__((__fallthrough__))
^
8 warnings generated.


vim +3815 sound/core/pcm_native.c

e88e8ae639a490 Takashi Iwai 2006-04-28 3798
^1da177e4c3f41 Linus Torvalds 2005-04-16 3799 static int snd_pcm_mmap(struct file *file, struct vm_area_struct *area)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3800 {
877211f5e1b119 Takashi Iwai 2005-11-17 3801 struct snd_pcm_file * pcm_file;
877211f5e1b119 Takashi Iwai 2005-11-17 3802 struct snd_pcm_substream *substream;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3803 unsigned long offset;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3804
^1da177e4c3f41 Linus Torvalds 2005-04-16 3805 pcm_file = file->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3806 substream = pcm_file->substream;
7eaa943c8ed8e9 Takashi Iwai 2008-08-08 3807 if (PCM_RUNTIME_CHECK(substream))
7eaa943c8ed8e9 Takashi Iwai 2008-08-08 3808 return -ENXIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3809
^1da177e4c3f41 Linus Torvalds 2005-04-16 3810 offset = area->vm_pgoff << PAGE_SHIFT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3811 switch (offset) {
80fe7430c70859 Arnd Bergmann 2018-04-24 3812 case SNDRV_PCM_MMAP_OFFSET_STATUS_OLD:
80fe7430c70859 Arnd Bergmann 2018-04-24 3813 if (pcm_file->no_compat_mmap || !IS_ENABLED(CONFIG_64BIT))
80fe7430c70859 Arnd Bergmann 2018-04-24 3814 return -ENXIO;
c0dbbdad4e11f8 Gustavo A. R. Silva 2020-07-08 @3815 fallthrough;
80fe7430c70859 Arnd Bergmann 2018-04-24 3816 case SNDRV_PCM_MMAP_OFFSET_STATUS_NEW:
42f945970af9df Takashi Iwai 2017-06-19 3817 if (!pcm_status_mmap_allowed(pcm_file))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3818 return -ENXIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3819 return snd_pcm_mmap_status(substream, file, area);
80fe7430c70859 Arnd Bergmann 2018-04-24 3820 case SNDRV_PCM_MMAP_OFFSET_CONTROL_OLD:
80fe7430c70859 Arnd Bergmann 2018-04-24 3821 if (pcm_file->no_compat_mmap || !IS_ENABLED(CONFIG_64BIT))
80fe7430c70859 Arnd Bergmann 2018-04-24 3822 return -ENXIO;
c0dbbdad4e11f8 Gustavo A. R. Silva 2020-07-08 3823 fallthrough;
80fe7430c70859 Arnd Bergmann 2018-04-24 3824 case SNDRV_PCM_MMAP_OFFSET_CONTROL_NEW:
b602aa8eb1a0f5 Takashi Iwai 2017-06-27 3825 if (!pcm_control_mmap_allowed(pcm_file))
^1da177e4c3f41 Linus Torvalds 2005-04-16 3826 return -ENXIO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3827 return snd_pcm_mmap_control(substream, file, area);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3828 default:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3829 return snd_pcm_mmap_data(substream, file, area);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3830 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3831 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3832 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3833

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip