Commit 729d8e09 authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds

mips: use %*pb[l] to print bitmaps including cpumasks and nodemasks

printk and friends can now format bitmaps using '%*pb[l]'.  cpumask
and nodemask also provide cpumask_pr_args() and nodemask_pr_args()
respectively which can be used to generate the two printf arguments
necessary to format the specified cpu/nodemask.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4a0792b0
...@@ -162,7 +162,6 @@ void __init nlm_smp_setup(void) ...@@ -162,7 +162,6 @@ void __init nlm_smp_setup(void)
unsigned int boot_cpu; unsigned int boot_cpu;
int num_cpus, i, ncore, node; int num_cpus, i, ncore, node;
volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY);
char buf[64];
boot_cpu = hard_smp_processor_id(); boot_cpu = hard_smp_processor_id();
cpumask_clear(&phys_cpu_present_mask); cpumask_clear(&phys_cpu_present_mask);
...@@ -189,10 +188,10 @@ void __init nlm_smp_setup(void) ...@@ -189,10 +188,10 @@ void __init nlm_smp_setup(void)
} }
} }
cpumask_scnprintf(buf, ARRAY_SIZE(buf), &phys_cpu_present_mask); pr_info("Physical CPU mask: %*pb\n",
pr_info("Physical CPU mask: %s\n", buf); cpumask_pr_args(&phys_cpu_present_mask));
cpumask_scnprintf(buf, ARRAY_SIZE(buf), cpu_possible_mask); pr_info("Possible CPU mask: %*pb\n",
pr_info("Possible CPU mask: %s\n", buf); cpumask_pr_args(cpu_possible_mask));
/* check with the cores we have woken up */ /* check with the cores we have woken up */
for (ncore = 0, i = 0; i < NLM_NR_NODES; i++) for (ncore = 0, i = 0; i < NLM_NR_NODES; i++)
...@@ -209,7 +208,6 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask) ...@@ -209,7 +208,6 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask)
{ {
uint32_t core0_thr_mask, core_thr_mask; uint32_t core0_thr_mask, core_thr_mask;
int threadmode, i, j; int threadmode, i, j;
char buf[64];
core0_thr_mask = 0; core0_thr_mask = 0;
for (i = 0; i < NLM_THREADS_PER_CORE; i++) for (i = 0; i < NLM_THREADS_PER_CORE; i++)
...@@ -244,8 +242,7 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask) ...@@ -244,8 +242,7 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask)
return threadmode; return threadmode;
unsupp: unsupp:
cpumask_scnprintf(buf, ARRAY_SIZE(buf), wakeup_mask); panic("Unsupported CPU mask %*pb", cpumask_pr_args(wakeup_mask));
panic("Unsupported CPU mask %s", buf);
return 0; return 0;
} }
......
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