* [android-common:android15-6.6-2025-09 1/1] lib/percpu_counter.c:178:36: sparse: sparse: cast removes address space '__percpu' of expression
@ 2026-03-31 13:06 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-31 13:06 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-31 13:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 13:06 [android-common:android15-6.6-2025-09 1/1] lib/percpu_counter.c:178:36: sparse: sparse: cast removes address space '__percpu' of expression kernel test robot
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.