diff options
author | Tejun Heo <tj@kernel.org> | 2015-02-13 17:37:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 00:21:36 -0500 |
commit | 729d8e093c3ec5c662965c97accd882a75b0f93a (patch) | |
tree | ff2f4141583f4c9d541d18c99093d7cdd475bee1 /arch/mips/netlogic | |
parent | 4a0792b0e7a6f0f7c49628fb1ae29b2643d4eff3 (diff) |
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: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r-- | arch/mips/netlogic/common/smp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c index 4fde7ac76cc9..e743bdd6e20c 100644 --- a/arch/mips/netlogic/common/smp.c +++ b/arch/mips/netlogic/common/smp.c | |||
@@ -162,7 +162,6 @@ void __init nlm_smp_setup(void) | |||
162 | unsigned int boot_cpu; | 162 | unsigned int boot_cpu; |
163 | int num_cpus, i, ncore, node; | 163 | int num_cpus, i, ncore, node; |
164 | volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); | 164 | volatile u32 *cpu_ready = nlm_get_boot_data(BOOT_CPU_READY); |
165 | char buf[64]; | ||
166 | 165 | ||
167 | boot_cpu = hard_smp_processor_id(); | 166 | boot_cpu = hard_smp_processor_id(); |
168 | cpumask_clear(&phys_cpu_present_mask); | 167 | cpumask_clear(&phys_cpu_present_mask); |
@@ -189,10 +188,10 @@ void __init nlm_smp_setup(void) | |||
189 | } | 188 | } |
190 | } | 189 | } |
191 | 190 | ||
192 | cpumask_scnprintf(buf, ARRAY_SIZE(buf), &phys_cpu_present_mask); | 191 | pr_info("Physical CPU mask: %*pb\n", |
193 | pr_info("Physical CPU mask: %s\n", buf); | 192 | cpumask_pr_args(&phys_cpu_present_mask)); |
194 | cpumask_scnprintf(buf, ARRAY_SIZE(buf), cpu_possible_mask); | 193 | pr_info("Possible CPU mask: %*pb\n", |
195 | pr_info("Possible CPU mask: %s\n", buf); | 194 | cpumask_pr_args(cpu_possible_mask)); |
196 | 195 | ||
197 | /* check with the cores we have woken up */ | 196 | /* check with the cores we have woken up */ |
198 | for (ncore = 0, i = 0; i < NLM_NR_NODES; i++) | 197 | for (ncore = 0, i = 0; i < NLM_NR_NODES; i++) |
@@ -209,7 +208,6 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask) | |||
209 | { | 208 | { |
210 | uint32_t core0_thr_mask, core_thr_mask; | 209 | uint32_t core0_thr_mask, core_thr_mask; |
211 | int threadmode, i, j; | 210 | int threadmode, i, j; |
212 | char buf[64]; | ||
213 | 211 | ||
214 | core0_thr_mask = 0; | 212 | core0_thr_mask = 0; |
215 | for (i = 0; i < NLM_THREADS_PER_CORE; i++) | 213 | for (i = 0; i < NLM_THREADS_PER_CORE; i++) |
@@ -244,8 +242,7 @@ static int nlm_parse_cpumask(cpumask_t *wakeup_mask) | |||
244 | return threadmode; | 242 | return threadmode; |
245 | 243 | ||
246 | unsupp: | 244 | unsupp: |
247 | cpumask_scnprintf(buf, ARRAY_SIZE(buf), wakeup_mask); | 245 | panic("Unsupported CPU mask %*pb", cpumask_pr_args(wakeup_mask)); |
248 | panic("Unsupported CPU mask %s", buf); | ||
249 | return 0; | 246 | return 0; |
250 | } | 247 | } |
251 | 248 | ||