Merge branch 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / kernel / sched / stats.c
index a476bea..87e2c9f 100644 (file)
 static int show_schedstat(struct seq_file *seq, void *v)
 {
        int cpu;
-       int mask_len = DIV_ROUND_UP(NR_CPUS, 32) * 9;
-       char *mask_str = kmalloc(mask_len, GFP_KERNEL);
-
-       if (mask_str == NULL)
-               return -ENOMEM;
 
        if (v == (void *)1) {
                seq_printf(seq, "version %d\n", SCHEDSTAT_VERSION);
@@ -50,9 +45,8 @@ static int show_schedstat(struct seq_file *seq, void *v)
                for_each_domain(cpu, sd) {
                        enum cpu_idle_type itype;
 
-                       cpumask_scnprintf(mask_str, mask_len,
-                                         sched_domain_span(sd));
-                       seq_printf(seq, "domain%d %s", dcount++, mask_str);
+                       seq_printf(seq, "domain%d %*pb", dcount++,
+                                  cpumask_pr_args(sched_domain_span(sd)));
                        for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES;
                                        itype++) {
                                seq_printf(seq, " %u %u %u %u %u %u %u %u",
@@ -76,7 +70,6 @@ static int show_schedstat(struct seq_file *seq, void *v)
                rcu_read_unlock();
 #endif
        }
-       kfree(mask_str);
        return 0;
 }