Skip to content

Commit

Permalink
lib/percpu_counter: add missing __percpu qualifier to a cast
Browse files Browse the repository at this point in the history
Add missing __percpu qualifier to a (void *) cast to fix

percpu_counter.c:212:36: warning: cast removes address space '__percpu' of expression
percpu_counter.c:212:33: warning: incorrect type in assignment (different address spaces)
percpu_counter.c:212:33:    expected signed int [noderef] [usertype] __percpu *counters
percpu_counter.c:212:33:    got void *

sparse warnings.

Found by GCC's named address space checks.

There were no changes in the resulting object file.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Uros Bizjak <[email protected]>
Cc: Dennis Zhou <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
ubizjak authored and akpm00 committed Sep 2, 2024
1 parent cbf164c commit 16d9691
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/percpu_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ int __percpu_counter_init_many(struct percpu_counter *fbc, s64 amount,
INIT_LIST_HEAD(&fbc[i].list);
#endif
fbc[i].count = amount;
fbc[i].counters = (void *)counters + (i * counter_size);
fbc[i].counters = (void __percpu *)counters + i * counter_size;

debug_percpu_counter_activate(&fbc[i]);
}
Expand Down

0 comments on commit 16d9691

Please sign in to comment.