Skip to content

Commit

Permalink
workqueue: use %*pb[l] to format bitmaps including cpumasks and nodem…
Browse files Browse the repository at this point in the history
…asks

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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
htejun authored and torvalds committed Feb 14, 2015
1 parent 807de07 commit dfbcbf4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -3083,10 +3083,9 @@ static ssize_t wq_cpumask_show(struct device *dev,
int written;

mutex_lock(&wq->mutex);
written = cpumask_scnprintf(buf, PAGE_SIZE, wq->unbound_attrs->cpumask);
written = scnprintf(buf, PAGE_SIZE, "%*pb\n",
cpumask_pr_args(wq->unbound_attrs->cpumask));
mutex_unlock(&wq->mutex);

written += scnprintf(buf + written, PAGE_SIZE - written, "\n");
return written;
}

Expand Down

0 comments on commit dfbcbf4

Please sign in to comment.