Skip to content

Commit 807de07

Browse files
htejuntorvalds
authored andcommitted
percpu: 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> Cc: Christoph Lameter <cl@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent ffda22c commit 807de07

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mm/percpu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,6 @@ static void pcpu_dump_alloc_info(const char *lvl,
15281528
int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
15291529
void *base_addr)
15301530
{
1531-
static char cpus_buf[4096] __initdata;
15321531
static int smap[PERCPU_DYNAMIC_EARLY_SLOTS] __initdata;
15331532
static int dmap[PERCPU_DYNAMIC_EARLY_SLOTS] __initdata;
15341533
size_t dyn_size = ai->dyn_size;
@@ -1541,12 +1540,11 @@ int __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
15411540
int *unit_map;
15421541
int group, unit, i;
15431542

1544-
cpumask_scnprintf(cpus_buf, sizeof(cpus_buf), cpu_possible_mask);
1545-
15461543
#define PCPU_SETUP_BUG_ON(cond) do { \
15471544
if (unlikely(cond)) { \
15481545
pr_emerg("PERCPU: failed to initialize, %s", #cond); \
1549-
pr_emerg("PERCPU: cpu_possible_mask=%s\n", cpus_buf); \
1546+
pr_emerg("PERCPU: cpu_possible_mask=%*pb\n", \
1547+
cpumask_pr_args(cpu_possible_mask)); \
15501548
pcpu_dump_alloc_info(KERN_EMERG, ai); \
15511549
BUG(); \
15521550
} \

0 commit comments

Comments
 (0)