Commit 848e2391 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds

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: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4b804c85
...@@ -200,7 +200,7 @@ static const struct attribute_group *hotplugable_cpu_attr_groups[] = { ...@@ -200,7 +200,7 @@ static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
struct cpu_attr { struct cpu_attr {
struct device_attribute attr; struct device_attribute attr;
const struct cpumask *const * const map; const struct cpumask *const map;
}; };
static ssize_t show_cpus_attr(struct device *dev, static ssize_t show_cpus_attr(struct device *dev,
...@@ -209,7 +209,7 @@ static ssize_t show_cpus_attr(struct device *dev, ...@@ -209,7 +209,7 @@ static ssize_t show_cpus_attr(struct device *dev,
{ {
struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr); struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr);
return cpumap_print_to_pagebuf(true, buf, *ca->map); return cpumap_print_to_pagebuf(true, buf, ca->map);
} }
#define _CPU_ATTR(name, map) \ #define _CPU_ATTR(name, map) \
...@@ -217,9 +217,9 @@ static ssize_t show_cpus_attr(struct device *dev, ...@@ -217,9 +217,9 @@ static ssize_t show_cpus_attr(struct device *dev,
/* Keep in sync with cpu_subsys_attrs */ /* Keep in sync with cpu_subsys_attrs */
static struct cpu_attr cpu_attrs[] = { static struct cpu_attr cpu_attrs[] = {
_CPU_ATTR(online, &cpu_online_mask), _CPU_ATTR(online, &__cpu_online_mask),
_CPU_ATTR(possible, &cpu_possible_mask), _CPU_ATTR(possible, &__cpu_possible_mask),
_CPU_ATTR(present, &cpu_present_mask), _CPU_ATTR(present, &__cpu_present_mask),
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment