diff options
| author | Tejun Heo <[email protected]> | 2015-02-13 22:37:56 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2015-02-14 05:21:38 +0000 |
| commit | f799b1a7fbd24cf0dc4fa33818c172bd70571bd1 (patch) | |
| tree | 650574cd56b463d1b7080f8a4a38f62c93ccff9d /drivers/base/node.c | |
| parent | usb: use %*pb[l] to print bitmaps including cpumasks and nodemasks (diff) | |
| download | kernel-f799b1a7fbd24cf0dc4fa33818c172bd70571bd1.tar.gz kernel-f799b1a7fbd24cf0dc4fa33818c172bd70571bd1.zip | |
drivers/base: 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.
* Line termination only requires one extra space at the end of the
buffer. Use PAGE_SIZE - 1 instead of PAGE_SIZE - 2 when formatting.
Signed-off-by: Tejun Heo <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'drivers/base/node.c')
| -rw-r--r-- | drivers/base/node.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c index a3b82e9c7f20..36fabe43cd44 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -605,7 +605,8 @@ static ssize_t print_nodes_state(enum node_states state, char *buf) { int n; - n = nodelist_scnprintf(buf, PAGE_SIZE-2, node_states[state]); + n = scnprintf(buf, PAGE_SIZE - 1, "%*pbl", + nodemask_pr_args(&node_states[state])); buf[n++] = '\n'; buf[n] = '\0'; return n; |
