All of lore.kernel.org
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, Tejun Heo <tj@kernel.org>
Subject: Re: [tj-wq:for-7.1 14/18] kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]'
Date: Thu, 9 Apr 2026 08:27:11 -0700	[thread overview]
Message-ID: <adfFCF_JsqNhh5nB@gmail.com> (raw)
In-Reply-To: <202604022343.GQtkF2vO-lkp@intel.com>

On Fri, Apr 03, 2026 at 04:42:14PM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-7.1
> head:   41e3ccca00b374b7f39cf68e818b59a921cd7069
> commit: 5920d046f7ae3bf9cf51b9d915c1fff13d299d84 [14/18] workqueue: add WQ_AFFN_CACHE_SHARD affinity scope
> config: nios2-randconfig-001-20260402 (https://download.01.org/0day-ci/archive/20260402/202604022343.GQtkF2vO-lkp@intel.com/config)
> compiler: nios2-linux-gcc (GCC) 8.5.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260402/202604022343.GQtkF2vO-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/202604022343.GQtkF2vO-lkp@intel.com/
> 
> All warnings (new ones prefixed by >>):
> 
>    kernel/workqueue.c: In function 'workqueue_init_topology':
> >> kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]' [-Warray-bounds]
>        cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)];
>                          ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I can finally reproduce it. This is related to nios2 having NR_CPU=1.

	In function ‘llc_populate_cpu_shard_id’,
	inlined from ‘precompute_cache_shard_ids’ at /home/leit/Devel/linux-next/kernel/workqueue.c:8321:3,
	inlined from ‘workqueue_init_topology’ at /home/leit/Devel/linux-next/kernel/workqueue.c:8354:2:
	/home/leit/Devel/linux-next/kernel/workqueue.c:8289:55: warning: array subscript 1 is above array bounds of ‘int[1]’ [-Warray-bounds]
	8289 |                         cpu_shard_id[c] = cpu_shard_id[cpumask_first(sibling_cpus)];
	|                                           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	/home/leit/Devel/linux-next/kernel/workqueue.c: In function ‘workqueue_init_topology’:
	/home/leit/Devel/linux-next/kernel/workqueue.c:8171:12: note: while referencing ‘cpu_shard_id’
	8171 | static int cpu_shard_id[NR_CPUS] __initdata;
	|            ^~~~~~~~~~~~
	make[1]: Leaving directory '/tmp/wq-nios2'


Working on a fix,

Thanks for the report, dear robot :-)
--breno

      reply	other threads:[~2026-04-09 15:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  8:42 [tj-wq:for-7.1 14/18] kernel/workqueue.c:8289:34: warning: array subscript 1 is above array bounds of 'int[1]' kernel test robot
2026-04-09 15:27 ` Breno Leitao [this message]

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=adfFCF_JsqNhh5nB@gmail.com \
    --to=leitao@debian.org \
    --cc=lkp@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.