linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: kbuild-all@lists.01.org,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [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: Wed, 9 Feb 2022 00:10:18 +0800	[thread overview]
Message-ID: <202202090028.zSZDO5zf-lkp@intel.com> (raw)

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@intel.com/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@intel.com>

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@shadowen.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

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


                 reply	other threads:[~2022-02-08 16:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202202090028.zSZDO5zf-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).