Pull cpumask into release branch
[sfrench/cifs-2.6.git] / arch / ia64 / sn / kernel / sn2 / sn_hwperf.c
index 636588e7e0684bbce76e6c304e694af7c19c2a32..45f3c23904286368187c10725bd59e3dd8dda1a3 100644 (file)
@@ -385,7 +385,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
        int j;
        const char *slabname;
        int ordinal;
-       cpumask_t cpumask;
        char slice;
        struct cpuinfo_ia64 *c;
        struct sn_hwperf_port_info *ptdata;
@@ -473,23 +472,21 @@ static int sn_topology_show(struct seq_file *s, void *d)
                 * CPUs on this node, if any
                 */
                if (!SN_HWPERF_IS_IONODE(obj)) {
-                       cpumask = node_to_cpumask(ordinal);
-                       for_each_online_cpu(i) {
-                               if (cpu_isset(i, cpumask)) {
-                                       slice = 'a' + cpuid_to_slice(i);
-                                       c = cpu_data(i);
-                                       seq_printf(s, "cpu %d %s%c local"
-                                               " freq %luMHz, arch ia64",
-                                               i, obj->location, slice,
-                                               c->proc_freq / 1000000);
-                                       for_each_online_cpu(j) {
-                                               seq_printf(s, j ? ":%d" : ", dist %d",
-                                                       node_distance(
+                       for_each_cpu_and(i, cpu_online_mask,
+                                        cpumask_of_node(ordinal)) {
+                               slice = 'a' + cpuid_to_slice(i);
+                               c = cpu_data(i);
+                               seq_printf(s, "cpu %d %s%c local"
+                                          " freq %luMHz, arch ia64",
+                                          i, obj->location, slice,
+                                          c->proc_freq / 1000000);
+                               for_each_online_cpu(j) {
+                                       seq_printf(s, j ? ":%d" : ", dist %d",
+                                                  node_distance(
                                                        cpu_to_node(i),
                                                        cpu_to_node(j)));
-                                       }
-                                       seq_putc(s, '\n');
                                }
+                               seq_putc(s, '\n');
                        }
                }
        }
@@ -615,7 +612,7 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
        op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK;
 
        if (cpu != SN_HWPERF_ARG_ANY_CPU) {
-               if (cpu >= NR_CPUS || !cpu_online(cpu)) {
+               if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
                        r = -EINVAL;
                        goto out;
                }