From: kernel test robot <lkp@intel.com>
To: Waiman Long <longman@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Tejun Heo <tj@kernel.org>
Subject: [linux-next:master 6144/6333] include/linux/bitmap.h:245:22: warning: array subscript 0 is outside array bounds of 'struct cpumask[0]'
Date: Tue, 19 Sep 2023 22:05:39 +0800 [thread overview]
Message-ID: <202309192149.5OtHmIo1-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 29e400e3ea486bf942b214769fc9778098114113
commit: e2ffe502ba4505ee9c7b432980c702b7801a37f3 [6144/6333] cgroup/cpuset: Add cpuset.cpus.exclusive for v2
config: i386-randconfig-013-20230914 (https://download.01.org/0day-ci/archive/20230919/202309192149.5OtHmIo1-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230919/202309192149.5OtHmIo1-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309192149.5OtHmIo1-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from include/linux/cpumask.h:12,
from arch/x86/include/asm/cpumask.h:5,
from arch/x86/include/asm/msr.h:11,
from arch/x86/include/asm/processor.h:23,
from arch/x86/include/asm/cpufeature.h:5,
from arch/x86/include/asm/thread_info.h:53,
from include/linux/thread_info.h:60,
from arch/x86/include/asm/preempt.h:9,
from include/linux/preempt.h:79,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from kernel/cgroup/cpuset.c:25:
In function 'bitmap_zero',
inlined from 'cpumask_clear' at include/linux/cpumask.h:554:2,
inlined from 'zalloc_cpumask_var' at include/linux/cpumask.h:931:2,
inlined from 'alloc_cpumasks.constprop' at kernel/cgroup/cpuset.c:627:7:
>> include/linux/bitmap.h:245:22: warning: array subscript 0 is outside array bounds of 'struct cpumask[0]' [-Warray-bounds]
245 | *dst = 0;
| ~~~~~^~~
In function 'bitmap_zero',
inlined from 'cpumask_clear' at include/linux/cpumask.h:554:2,
inlined from 'zalloc_cpumask_var' at include/linux/cpumask.h:931:2,
inlined from 'alloc_cpumasks.constprop' at kernel/cgroup/cpuset.c:633:7:
>> include/linux/bitmap.h:245:22: warning: array subscript 0 is outside array bounds of 'struct cpumask[0]' [-Warray-bounds]
245 | *dst = 0;
| ~~~~~^~~
vim +245 include/linux/bitmap.h
^1da177e4c3f41 Linus Torvalds 2005-04-16 239
8b4daad52fee77 Rasmus Villemoes 2015-02-12 240 static inline void bitmap_zero(unsigned long *dst, unsigned int nbits)
^1da177e4c3f41 Linus Torvalds 2005-04-16 241 {
8b4daad52fee77 Rasmus Villemoes 2015-02-12 242 unsigned int len = BITS_TO_LONGS(nbits) * sizeof(unsigned long);
3e7e5baaaba780 Alexander Lobakin 2022-06-24 243
3e7e5baaaba780 Alexander Lobakin 2022-06-24 244 if (small_const_nbits(nbits))
3e7e5baaaba780 Alexander Lobakin 2022-06-24 @245 *dst = 0;
3e7e5baaaba780 Alexander Lobakin 2022-06-24 246 else
^1da177e4c3f41 Linus Torvalds 2005-04-16 247 memset(dst, 0, len);
^1da177e4c3f41 Linus Torvalds 2005-04-16 248 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 249
:::::: The code at line 245 was first introduced by commit
:::::: 3e7e5baaaba78075a7f3a57432609e363bf2a486 bitmap: don't assume compiler evaluates small mem*() builtins calls
:::::: TO: Alexander Lobakin <alexandr.lobakin@intel.com>
:::::: CC: Yury Norov <yury.norov@gmail.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2023-09-19 14:06 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=202309192149.5OtHmIo1-lkp@intel.com \
--to=lkp@intel.com \
--cc=linux-mm@kvack.org \
--cc=longman@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tj@kernel.org \
/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).