Skip to content

Commit 9e763e0

Browse files
htejuntorvalds
authored andcommitted
mm: 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. Signed-off-by: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 5024c1d commit 9e763e0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

mm/mempolicy.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -2817,8 +2817,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
28172817
p += snprintf(p, buffer + maxlen - p, "relative");
28182818
}
28192819

2820-
if (!nodes_empty(nodes)) {
2821-
p += snprintf(p, buffer + maxlen - p, ":");
2822-
p += nodelist_scnprintf(p, buffer + maxlen - p, nodes);
2823-
}
2820+
if (!nodes_empty(nodes))
2821+
p += scnprintf(p, buffer + maxlen - p, ":%*pbl",
2822+
nodemask_pr_args(&nodes));
28242823
}

0 commit comments

Comments
 (0)