diff options
author | Tejun Heo <tj@kernel.org> | 2015-02-13 17:37:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 00:21:38 -0500 |
commit | f799b1a7fbd24cf0dc4fa33818c172bd70571bd1 (patch) | |
tree | 650574cd56b463d1b7080f8a4a38f62c93ccff9d /drivers/base/node.c | |
parent | 125918dbd836d19b5dccc2690388b29e575f91a4 (diff) |
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 <tj@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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) | |||
605 | { | 605 | { |
606 | int n; | 606 | int n; |
607 | 607 | ||
608 | n = nodelist_scnprintf(buf, PAGE_SIZE-2, node_states[state]); | 608 | n = scnprintf(buf, PAGE_SIZE - 1, "%*pbl", |
609 | nodemask_pr_args(&node_states[state])); | ||
609 | buf[n++] = '\n'; | 610 | buf[n++] = '\n'; |
610 | buf[n] = '\0'; | 611 | buf[n] = '\0'; |
611 | return n; | 612 | return n; |