Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636971 > unrolled thread

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

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-06 21:50 +0200
Last post2017-05-06 21:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] kernel-sched: Combine two seq_printf() calls into one in  show_schedstat() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-06 21:50 +0200

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

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-06 21:50 +0200
Subject[PATCH 3/3] kernel-sched: Combine two seq_printf() calls into one in show_schedstat()
Message-ID<tEdSh-3MB-1@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
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@users.sourceforge.net>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web