Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/base/cpu.c: use __cpu_*_mask directly

The only user of the lvalue-ness of the cpu_*_mask variables is in
drivers/base/cpu.c, and that is mostly a work-around for the fact that not
even const variables can be used in static initialization. Now that the
underlying struct cpumasks are exposed we can take their address.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Rasmus Villemoes and committed by
Linus Torvalds
848e2391 4b804c85

+5 -5
+5 -5
drivers/base/cpu.c
··· 200 200 201 201 struct cpu_attr { 202 202 struct device_attribute attr; 203 - const struct cpumask *const * const map; 203 + const struct cpumask *const map; 204 204 }; 205 205 206 206 static ssize_t show_cpus_attr(struct device *dev, ··· 209 209 { 210 210 struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); 211 211 212 - return cpumap_print_to_pagebuf(true, buf, *ca->map); 212 + return cpumap_print_to_pagebuf(true, buf, ca->map); 213 213 } 214 214 215 215 #define _CPU_ATTR(name, map) \ ··· 217 217 218 218 /* Keep in sync with cpu_subsys_attrs */ 219 219 static struct cpu_attr cpu_attrs[] = { 220 - _CPU_ATTR(online, &cpu_online_mask), 221 - _CPU_ATTR(possible, &cpu_possible_mask), 222 - _CPU_ATTR(present, &cpu_present_mask), 220 + _CPU_ATTR(online, &__cpu_online_mask), 221 + _CPU_ATTR(possible, &__cpu_possible_mask), 222 + _CPU_ATTR(present, &__cpu_present_mask), 223 223 }; 224 224 225 225 /*