linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] blk-mq-debugfs: Fine-tuning for five function implementations
@ 2017-05-03 18:34 SF Markus Elfring
  2017-05-03 18:35 ` [PATCH 1/2] blk-mq-debugfs: Replace seven seq_puts() calls by seq_putc() SF Markus Elfring
  2017-05-03 18:36 ` [PATCH 2/2] blk-mq-debugfs: Add spaces in queue_poll_stat_show() SF Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-05-03 18:34 UTC (permalink / raw)
  To: linux-block, Bart Van Assche, Jens Axboe; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 3 May 2017 20:30:40 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Replace seven seq_puts() calls by seq_putc()
  Add spaces in queue_poll_stat_show()

 block/blk-mq-debugfs.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

-- 
2.12.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] blk-mq-debugfs: Replace seven seq_puts() calls by seq_putc()
  2017-05-03 18:34 [PATCH 0/2] blk-mq-debugfs: Fine-tuning for five function implementations SF Markus Elfring
@ 2017-05-03 18:35 ` SF Markus Elfring
  2017-05-03 18:36 ` [PATCH 2/2] blk-mq-debugfs: Add spaces in queue_poll_stat_show() SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-05-03 18:35 UTC (permalink / raw)
  To: linux-block, Bart Van Assche, Jens Axboe; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 3 May 2017 20:00:49 +0200

A few single characters should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 block/blk-mq-debugfs.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index bcd2a7d4a3a5..2265b70b1121 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -53,7 +53,7 @@ static int blk_flags_show(struct seq_file *m, const unsigned long flags,
 		if (!(flags & BIT(i)))
 			continue;
 		if (sep)
-			seq_puts(m, " ");
+			seq_putc(m, ' ');
 		sep = true;
 		if (i < flag_name_count && flag_name[i])
 			seq_puts(m, flag_name[i]);
@@ -101,7 +101,7 @@ static int blk_queue_flags_show(struct seq_file *m, void *v)
 
 	blk_flags_show(m, q->queue_flags, blk_queue_flag_name,
 		       ARRAY_SIZE(blk_queue_flag_name));
-	seq_puts(m, "\n");
+	seq_putc(m, '\n');
 	return 0;
 }
 
@@ -159,11 +159,10 @@ static int queue_poll_stat_show(struct seq_file *m, void *v)
 	for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS/2; bucket++) {
 		seq_printf(m, "read  (%d Bytes): ", 1 << (9+bucket));
 		print_stat(m, &q->poll_stat[2*bucket]);
-		seq_puts(m, "\n");
-
+		seq_putc(m, '\n');
 		seq_printf(m, "write (%d Bytes): ",  1 << (9+bucket));
 		print_stat(m, &q->poll_stat[2*bucket+1]);
-		seq_puts(m, "\n");
+		seq_putc(m, '\n');
 	}
 	return 0;
 }
@@ -193,7 +192,7 @@ static int hctx_state_show(struct seq_file *m, void *v)
 
 	blk_flags_show(m, hctx->state, hctx_state_name,
 		       ARRAY_SIZE(hctx_state_name));
-	seq_puts(m, "\n");
+	seq_putc(m, '\n');
 	return 0;
 }
 
@@ -233,11 +232,11 @@ static int hctx_flags_show(struct seq_file *m, void *v)
 		seq_puts(m, alloc_policy_name[alloc_policy]);
 	else
 		seq_printf(m, "%d", alloc_policy);
-	seq_puts(m, " ");
+	seq_putc(m, ' ');
 	blk_flags_show(m,
 		       hctx->flags ^ BLK_ALLOC_POLICY_TO_MQ_FLAG(alloc_policy),
 		       hctx_flag_name, ARRAY_SIZE(hctx_flag_name));
-	seq_puts(m, "\n");
+	seq_putc(m, '\n');
 	return 0;
 }
 
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] blk-mq-debugfs: Add spaces in queue_poll_stat_show()
  2017-05-03 18:34 [PATCH 0/2] blk-mq-debugfs: Fine-tuning for five function implementations SF Markus Elfring
  2017-05-03 18:35 ` [PATCH 1/2] blk-mq-debugfs: Replace seven seq_puts() calls by seq_putc() SF Markus Elfring
@ 2017-05-03 18:36 ` SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-05-03 18:36 UTC (permalink / raw)
  To: linux-block, Bart Van Assche, Jens Axboe; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 3 May 2017 20:18:22 +0200

Use space characters at some source code places according to
the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 block/blk-mq-debugfs.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 2265b70b1121..34cdd5f2b511 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -156,12 +156,12 @@ static int queue_poll_stat_show(struct seq_file *m, void *v)
 	struct request_queue *q = m->private;
 	int bucket;
 
-	for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS/2; bucket++) {
-		seq_printf(m, "read  (%d Bytes): ", 1 << (9+bucket));
-		print_stat(m, &q->poll_stat[2*bucket]);
+	for (bucket = 0; bucket < BLK_MQ_POLL_STATS_BKTS / 2; bucket++) {
+		seq_printf(m, "read  (%d Bytes): ", 1 << (9 + bucket));
+		print_stat(m, &q->poll_stat[2 * bucket]);
 		seq_putc(m, '\n');
-		seq_printf(m, "write (%d Bytes): ",  1 << (9+bucket));
-		print_stat(m, &q->poll_stat[2*bucket+1]);
+		seq_printf(m, "write (%d Bytes): ",  1 << (9 + bucket));
+		print_stat(m, &q->poll_stat[2 * bucket + 1]);
 		seq_putc(m, '\n');
 	}
 	return 0;
-- 
2.12.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-03 18:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 18:34 [PATCH 0/2] blk-mq-debugfs: Fine-tuning for five function implementations SF Markus Elfring
2017-05-03 18:35 ` [PATCH 1/2] blk-mq-debugfs: Replace seven seq_puts() calls by seq_putc() SF Markus Elfring
2017-05-03 18:36 ` [PATCH 2/2] blk-mq-debugfs: Add spaces in queue_poll_stat_show() SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).