From: Tejun Heo Date: Fri, 13 Feb 2015 22:38:02 +0000 (-0800) Subject: mm: use %*pb[l] to print bitmaps including cpumasks and nodemasks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e763e0f4f94d5f9ac8928867a4399ec3b3c7e33;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/mempolicy.c b/mm/mempolicy.c index c75f4dcec808..4721046a134a 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2817,8 +2817,7 @@ void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol) p += snprintf(p, buffer + maxlen - p, "relative"); } - if (!nodes_empty(nodes)) { - p += snprintf(p, buffer + maxlen - p, ":"); - p += nodelist_scnprintf(p, buffer + maxlen - p, nodes); - } + if (!nodes_empty(nodes)) + p += scnprintf(p, buffer + maxlen - p, ":%*pbl", + nodemask_pr_args(&nodes)); }