s390/topology: get rid of core mask array
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Thu, 9 Mar 2017 09:02:28 +0000 (10:02 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 22 Mar 2017 07:29:07 +0000 (08:29 +0100)
Use a single long value instead of a single element array to represent
the core mask. The array is a leftover from 32/31 bit code so we were
able to use bitops helper functions.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/sysinfo.h
arch/s390/kernel/topology.c

index 229326c..2739498 100644 (file)
@@ -142,7 +142,6 @@ struct sysinfo_3_2_2 {
 
 extern int topology_max_mnest;
 
-#define TOPOLOGY_CORE_BITS     64
 #define TOPOLOGY_NR_MAG                6
 
 struct topology_core {
@@ -152,7 +151,7 @@ struct topology_core {
        unsigned char pp:2;
        unsigned char reserved1;
        unsigned short origin;
-       unsigned long mask[TOPOLOGY_CORE_BITS / BITS_PER_LONG];
+       unsigned long mask;
 };
 
 struct topology_container {
index 17660e8..0537130 100644 (file)
@@ -83,6 +83,8 @@ static cpumask_t cpu_thread_map(unsigned int cpu)
        return mask;
 }
 
+#define TOPOLOGY_CORE_BITS     64
+
 static void add_cpus_to_mask(struct topology_core *tl_core,
                             struct mask_info *drawer,
                             struct mask_info *book,
@@ -91,7 +93,7 @@ static void add_cpus_to_mask(struct topology_core *tl_core,
        struct cpu_topology_s390 *topo;
        unsigned int core;
 
-       for_each_set_bit(core, &tl_core->mask[0], TOPOLOGY_CORE_BITS) {
+       for_each_set_bit(core, &tl_core->mask, TOPOLOGY_CORE_BITS) {
                unsigned int rcore;
                int lcpu, i;