[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1418226774-30215-8-git-send-email-tj@kernel.org>
Date: Wed, 10 Dec 2014 10:52:49 -0500
From: Tejun Heo <tj@...nel.org>
To: akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
linux-xtensa@...ux-xtensa.org
Subject: [PATCH 07/12] xtensa: use {cpu|node}mask pr_cont and seq output functions
Convert the existing user of cpu{mask|list}_scnprintf() and
node{mask|list}_scnprintf() which use them just to printk or
seq_printf() the resulting buffer to use the following functions
instead respectively.
* For printk: cpu{mask|list}_pr_cont() and node{mask|list}_pr_cont().
* For seq_file: seq_cpumask[_list]() and seq_nodemask[_list]().
Because these conversions usually break up a single output function
call into multiple, the reduction is LOC isn't too big but it removes
unnecessary complexity and/or arbitrary limit on the length printed.
This patch is dependent on the previous patch ("bitmap, cpumask,
nodemask: implement pr_cont variants of formatting functions") which
is planned to go through -mm. It'd be the easiest to route this
together. If this should go through the subsystem tree, please wait
till the forementioned patch is merged to mainline.
Signed-off-by: Tejun Heo <tj@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Chris Zankel <chris@...kel.net>
Cc: Max Filippov <jcmvbkbc@...il.com>
Cc: linux-xtensa@...ux-xtensa.org
---
arch/xtensa/kernel/setup.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
index 06370cc..441f505 100644
--- a/arch/xtensa/kernel/setup.c
+++ b/arch/xtensa/kernel/setup.c
@@ -574,12 +574,12 @@ void machine_power_off(void)
static int
c_show(struct seq_file *f, void *slot)
{
- char buf[NR_CPUS * 5];
-
- cpulist_scnprintf(buf, sizeof(buf), cpu_online_mask);
/* high-level stuff */
seq_printf(f, "CPU count\t: %u\n"
- "CPU list\t: %s\n"
+ "CPU list\t: ",
+ num_online_cpus());
+ seq_cpumask_list(f, cpu_online_mask);
+ seq_printf(f, "\n"
"vendor_id\t: Tensilica\n"
"model\t\t: Xtensa " XCHAL_HW_VERSION_NAME "\n"
"core ID\t\t: " XCHAL_CORE_ID "\n"
@@ -587,8 +587,6 @@ c_show(struct seq_file *f, void *slot)
"byte order\t: %s\n"
"cpu MHz\t\t: %lu.%02lu\n"
"bogomips\t: %lu.%02lu\n",
- num_online_cpus(),
- buf,
XCHAL_BUILD_UNIQUE_ID,
XCHAL_HAVE_BE ? "big" : "little",
ccount_freq/1000000,
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists