From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [android-common:android15-6.6-2025-09 1/1] lib/percpu_counter.c:178:36: sparse: sparse: cast removes address space '__percpu' of expression
Date: Tue, 31 Mar 2026 21:06:20 +0800 [thread overview]
Message-ID: <202603312007.XjsEbKEW-lkp@intel.com> (raw)
tree: https://android.googlesource.com/kernel/common android15-6.6-2025-09
head: b93ae26d721ce546bfc68d0bf0819a00ac746e7b
commit: c439d5e8a0deb7310b5bb4e5f2fe47c40ff5297f [1/1] pcpcntr: add group allocation/free
config: i386-randconfig-r112-20260331 (https://download.01.org/0day-ci/archive/20260331/202603312007.XjsEbKEW-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260331/202603312007.XjsEbKEW-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/202603312007.XjsEbKEW-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> lib/percpu_counter.c:178:36: sparse: sparse: cast removes address space '__percpu' of expression
>> lib/percpu_counter.c:178:33: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected signed int [noderef] [usertype] __percpu *counters @@ got void * @@
lib/percpu_counter.c:178:33: sparse: expected signed int [noderef] [usertype] __percpu *counters
lib/percpu_counter.c:178:33: sparse: got void *
vim +/__percpu +178 lib/percpu_counter.c
153
154 int __percpu_counter_init_many(struct percpu_counter *fbc, s64 amount,
155 gfp_t gfp, u32 nr_counters,
156 struct lock_class_key *key)
157 {
158 unsigned long flags __maybe_unused;
159 size_t counter_size;
160 s32 __percpu *counters;
161 u32 i;
162
163 counter_size = ALIGN(sizeof(*counters), __alignof__(*counters));
164 counters = __alloc_percpu_gfp(nr_counters * counter_size,
165 __alignof__(*counters), gfp);
166 if (!counters) {
167 fbc[0].counters = NULL;
168 return -ENOMEM;
169 }
170
171 for (i = 0; i < nr_counters; i++) {
172 raw_spin_lock_init(&fbc[i].lock);
173 lockdep_set_class(&fbc[i].lock, key);
174 #ifdef CONFIG_HOTPLUG_CPU
175 INIT_LIST_HEAD(&fbc[i].list);
176 #endif
177 fbc[i].count = amount;
> 178 fbc[i].counters = (void *)counters + (i * counter_size);
179
180 debug_percpu_counter_activate(&fbc[i]);
181 }
182
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-03-31 13: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=202603312007.XjsEbKEW-lkp@intel.com \
--to=lkp@intel.com \
--cc=cros-kernel-buildreports@googlegroups.com \
--cc=oe-kbuild-all@lists.linux.dev \
/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.