[linux-next:master 4438/4439] include/linux/mmzone.h:1431:23: warning: array subscript 32 is outside array bounds of 'struct mem_section[32][1]'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   554f92dbda161fa073844ae6c62db257b8860a0a
commit: c052f4a3cbf1f171a3ceedd76b70d6acf2718d34 [4438/4439] Merge branch 'akpm-current/current'
config: arm-randconfig-c002-20220208 (https://download.01.org/0day-ci/archive/20220209/202202090028.zSZDO5zf-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
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
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c052f4a3cbf1f171a3ceedd76b70d6acf2718d34
        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 c052f4a3cbf1f171a3ceedd76b70d6acf2718d34
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash fs/

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:17,
                    from fs/direct-io.c:24:
   fs/direct-io.c: In function 'dio_zero_block':
>> include/linux/mmzone.h:1431:23: warning: array subscript 32 is outside array bounds of 'struct mem_section[32][1]' [-Warray-bounds]
    1431 |         unsigned long map = section->section_mem_map;
         |                       ^~~
   include/linux/mmzone.h:1389:27: note: while referencing 'mem_section'
    1389 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
         |                           ^~~~~~~~~~~
   fs/direct-io.c: In function 'do_direct_IO':
>> include/linux/mmzone.h:1431:23: warning: array subscript 32 is outside array bounds of 'struct mem_section[32][1]' [-Warray-bounds]
    1431 |         unsigned long map = section->section_mem_map;
         |                       ^~~
   include/linux/mmzone.h:1389:27: note: while referencing 'mem_section'
    1389 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
         |                           ^~~~~~~~~~~
--
   In file included from include/linux/gfp.h:6,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:9,
                    from include/linux/module.h:17,
                    from fs/iomap/direct-io.c:6:
   fs/iomap/direct-io.c: In function 'iomap_dio_zero':
>> include/linux/mmzone.h:1431:23: warning: array subscript 32 is outside array bounds of 'struct mem_section[32][1]' [-Warray-bounds]
    1431 |         unsigned long map = section->section_mem_map;
         |                       ^~~
   include/linux/mmzone.h:1389:27: note: while referencing 'mem_section'
    1389 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT];
         |                           ^~~~~~~~~~~


vim +1431 include/linux/mmzone.h

29751f6991e845 Andy Whitcroft 2005-06-23  1428  
29751f6991e845 Andy Whitcroft 2005-06-23  1429  static inline struct page *__section_mem_map_addr(struct mem_section *section)
29751f6991e845 Andy Whitcroft 2005-06-23  1430  {
29751f6991e845 Andy Whitcroft 2005-06-23 @1431  	unsigned long map = section->section_mem_map;
29751f6991e845 Andy Whitcroft 2005-06-23  1432  	map &= SECTION_MAP_MASK;
29751f6991e845 Andy Whitcroft 2005-06-23  1433  	return (struct page *)map;
29751f6991e845 Andy Whitcroft 2005-06-23  1434  }
29751f6991e845 Andy Whitcroft 2005-06-23  1435  

:::::: The code at line 1431 was first introduced by commit
:::::: 29751f6991e845f7d002a6ae520bf996b38c8dcd [PATCH] sparsemem hotplug base

:::::: TO: Andy Whitcroft <apw@xxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux