[PATCH 3/3] kernel-sched: Combine two seq_printf() calls into one in show_schedstat()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 6 May 2017 21:26:19 +0200

Some data were put into a sequence by two separate function calls.
Print the same data by a single function call instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
 kernel/sched/stats.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c
index 87e2c9f0c33e..05ee4b6dcfca 100644
--- a/kernel/sched/stats.c
+++ b/kernel/sched/stats.c
@@ -30,15 +30,11 @@ static int show_schedstat(struct seq_file *seq, void *v)
 
 		/* runqueue-specific stats */
 		seq_printf(seq,
-		    "cpu%d %u 0 %u %u %u %u %llu %llu %lu",
-		    cpu, rq->yld_count,
-		    rq->sched_count, rq->sched_goidle,
-		    rq->ttwu_count, rq->ttwu_local,
-		    rq->rq_cpu_time,
-		    rq->rq_sched_info.run_delay, rq->rq_sched_info.pcount);
-
-		seq_printf(seq, "\n");
-
+			   "cpu%d %u 0 %u %u %u %u %llu %llu %lu\n",
+			   cpu, rq->yld_count, rq->sched_count,
+			   rq->sched_goidle, rq->ttwu_count, rq->ttwu_local,
+			   rq->rq_cpu_time, rq->rq_sched_info.run_delay,
+			   rq->rq_sched_info.pcount);
 #ifdef CONFIG_SMP
 		/* domain-specific stats */
 		rcu_read_lock();
-- 
2.12.2

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux