Skip to content

Commit dfbcbf4

Browse files
htejuntorvalds
authored andcommitted
workqueue: use %*pb[l] to format 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>
1 parent 807de07 commit dfbcbf4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/workqueue.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3083,10 +3083,9 @@ static ssize_t wq_cpumask_show(struct device *dev,
30833083
int written;
30843084

30853085
mutex_lock(&wq->mutex);
3086-
written = cpumask_scnprintf(buf, PAGE_SIZE, wq->unbound_attrs->cpumask);
3086+
written = scnprintf(buf, PAGE_SIZE, "%*pb\n",
3087+
cpumask_pr_args(wq->unbound_attrs->cpumask));
30873088
mutex_unlock(&wq->mutex);
3088-
3089-
written += scnprintf(buf + written, PAGE_SIZE - written, "\n");
30903089
return written;
30913090
}
30923091

0 commit comments

Comments
 (0)