linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 2090/2633] include/linux/mm.h:171:10: warning: no case matching constant switch condition '128'
@ 2021-05-12 13:33 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-12 13:33 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: kbuild-all, clang-built-linux, Linux Memory Management List,
	Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 7687 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ec85c95b0c90a17413901b018e8ade7b9eae7cad
commit: 07f9193834d0574e4b0ff93b6d3b674c9534bf7d [2090/2633] mm/thp: make ALLOC_SPLIT_PTLOCKS dependent on USE_SPLIT_PTE_PTLOCKS
config: x86_64-randconfig-a013-20210512 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=07f9193834d0574e4b0ff93b6d3b674c9534bf7d
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 07f9193834d0574e4b0ff93b6d3b674c9534bf7d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:28:
   In file included from include/linux/cgroup-defs.h:22:
   In file included from include/linux/bpf-cgroup.h:5:
   In file included from include/linux/bpf.h:20:
   In file included from include/linux/kallsyms.h:12:
>> include/linux/mm.h:171:10: warning: no case matching constant switch condition '128'
           switch (sizeof(struct page)) {
                   ^~~~~~~~~~~~~~~~~~~
   1 warning generated.
--
   In file included from arch/x86/entry/vdso/vma.c:7:
>> include/linux/mm.h:171:10: warning: no case matching constant switch condition '128'
           switch (sizeof(struct page)) {
                   ^~~~~~~~~~~~~~~~~~~
   arch/x86/entry/vdso/vma.c:35:19: warning: no previous prototype for function 'arch_get_vdso_data' [-Wmissing-prototypes]
   struct vdso_data *arch_get_vdso_data(void *vvar_page)
                     ^
   arch/x86/entry/vdso/vma.c:35:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   struct vdso_data *arch_get_vdso_data(void *vvar_page)
   ^
   static 
   2 warnings generated.
--
   In file included from arch/x86/kernel/asm-offsets.c:13:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:28:
   In file included from include/linux/cgroup-defs.h:22:
   In file included from include/linux/bpf-cgroup.h:5:
   In file included from include/linux/bpf.h:20:
   In file included from include/linux/kallsyms.h:12:
>> include/linux/mm.h:171:10: warning: no case matching constant switch condition '128'
           switch (sizeof(struct page)) {
                   ^~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +/128 +171 include/linux/mm.h

593befa6ab74a8 Dominik Dingel      2014-10-23  147  
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  148  /*
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  149   * On some architectures it is expensive to call memset() for small sizes.
5470dea49f5382 Alexander Duyck     2019-05-13  150   * If an architecture decides to implement their own version of
5470dea49f5382 Alexander Duyck     2019-05-13  151   * mm_zero_struct_page they should wrap the defines below in a #ifndef and
5470dea49f5382 Alexander Duyck     2019-05-13  152   * define their own version of this macro in <asm/pgtable.h>
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  153   */
5470dea49f5382 Alexander Duyck     2019-05-13  154  #if BITS_PER_LONG == 64
5470dea49f5382 Alexander Duyck     2019-05-13  155  /* This function must be updated when the size of struct page grows above 80
5470dea49f5382 Alexander Duyck     2019-05-13  156   * or reduces below 56. The idea that compiler optimizes out switch()
5470dea49f5382 Alexander Duyck     2019-05-13  157   * statement, and only leaves move/store instructions. Also the compiler can
5470dea49f5382 Alexander Duyck     2019-05-13  158   * combine write statments if they are both assignments and can be reordered,
5470dea49f5382 Alexander Duyck     2019-05-13  159   * this can result in several of the writes here being dropped.
5470dea49f5382 Alexander Duyck     2019-05-13  160   */
5470dea49f5382 Alexander Duyck     2019-05-13  161  #define	mm_zero_struct_page(pp) __mm_zero_struct_page(pp)
5470dea49f5382 Alexander Duyck     2019-05-13  162  static inline void __mm_zero_struct_page(struct page *page)
5470dea49f5382 Alexander Duyck     2019-05-13  163  {
5470dea49f5382 Alexander Duyck     2019-05-13  164  	unsigned long *_pp = (void *)page;
5470dea49f5382 Alexander Duyck     2019-05-13  165  
5470dea49f5382 Alexander Duyck     2019-05-13  166  	 /* Check that struct page is either 56, 64, 72, or 80 bytes */
5470dea49f5382 Alexander Duyck     2019-05-13  167  	BUILD_BUG_ON(sizeof(struct page) & 7);
5470dea49f5382 Alexander Duyck     2019-05-13  168  	BUILD_BUG_ON(sizeof(struct page) < 56);
5470dea49f5382 Alexander Duyck     2019-05-13  169  	BUILD_BUG_ON(sizeof(struct page) > 80);
5470dea49f5382 Alexander Duyck     2019-05-13  170  
5470dea49f5382 Alexander Duyck     2019-05-13 @171  	switch (sizeof(struct page)) {
5470dea49f5382 Alexander Duyck     2019-05-13  172  	case 80:
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  173  		_pp[9] = 0;
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  174  		fallthrough;
5470dea49f5382 Alexander Duyck     2019-05-13  175  	case 72:
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  176  		_pp[8] = 0;
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  177  		fallthrough;
5470dea49f5382 Alexander Duyck     2019-05-13  178  	case 64:
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  179  		_pp[7] = 0;
df561f6688fef7 Gustavo A. R. Silva 2020-08-23  180  		fallthrough;
5470dea49f5382 Alexander Duyck     2019-05-13  181  	case 56:
5470dea49f5382 Alexander Duyck     2019-05-13  182  		_pp[6] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  183  		_pp[5] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  184  		_pp[4] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  185  		_pp[3] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  186  		_pp[2] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  187  		_pp[1] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  188  		_pp[0] = 0;
5470dea49f5382 Alexander Duyck     2019-05-13  189  	}
5470dea49f5382 Alexander Duyck     2019-05-13  190  }
5470dea49f5382 Alexander Duyck     2019-05-13  191  #else
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  192  #define mm_zero_struct_page(pp)  ((void)memset((pp), 0, sizeof(struct page)))
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  193  #endif
a4a3ede2132ae0 Pavel Tatashin      2017-11-15  194  

:::::: The code at line 171 was first introduced by commit
:::::: 5470dea49f5382257c242ac617d908267727f1a8 mm: use mm_zero_struct_page from SPARC on all 64b architectures

:::::: TO: Alexander Duyck <alexander.h.duyck@linux.intel.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31931 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-12 13:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 13:33 [linux-next:master 2090/2633] include/linux/mm.h:171:10: warning: no case matching constant switch condition '128' kernel test robot

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).