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.
Showing the changes to kernel/workqueue.c (1 of 1 file). Show all
Unified · Split
| @@ -3083,10 +3083,9 @@ static ssize_t wq_cpumask_show(struct device *dev, · 3082 unmodified lines | |||
| 3083 | int written; | 3083 | int written; |
| 3084 | 3084 | ||
| 3085 | mutex_lock(&wq->mutex); | 3085 | 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)); | ||
| 3087 | mutex_unlock(&wq->mutex); | 3088 | mutex_unlock(&wq->mutex); |
| 3088 | |||
| 3089 | written += scnprintf(buf + written, PAGE_SIZE - written, "\n"); | ||
| 3090 | return written; | 3089 | return written; |
| 3091 | } | 3090 | } |
| 3092 | 3091 | ||