Commit 4497da6f authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds
Browse files

padata: 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 <>
Cc: Steffen Klassert <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 9e763e0f
......@@ -917,15 +917,10 @@ static ssize_t show_cpumask(struct padata_instance *pinst,
cpumask = pinst->cpumask.pcpu;
len = bitmap_scnprintf(buf, PAGE_SIZE, cpumask_bits(cpumask),
if (PAGE_SIZE - len < 2)
len = -EINVAL;
len += sprintf(buf + len, "\n");
len = snprintf(buf, PAGE_SIZE, "%*pb\n",
nr_cpu_ids, cpumask_bits(cpumask));
return len;
return len < PAGE_SIZE ? len : -EINVAL;
static ssize_t store_cpumask(struct padata_instance *pinst,
Supports Markdown
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