linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: Use seq_puts() in __blk_mq_debugfs_rq_show()
@ 2019-07-01 19:27 Markus Elfring
  2019-07-01 19:47 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2019-07-01 19:27 UTC (permalink / raw)
  To: linux-block, Jens Axboe; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 Jul 2019 21:21:04 +0200

A string which did not contain a data format specification should be put
into a sequence. Thus use the corresponding function “seq_puts”.

This issue was detected by using the Coccinelle software.

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

diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 748164f4e8b1..bc1b70aeb2ca 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -331,7 +331,7 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
 	if (strcmp(op_str, "UNKNOWN") == 0)
 		seq_printf(m, "%u", op);
 	else
-		seq_printf(m, "%s", op_str);
+		seq_puts(m, op_str);
 	seq_puts(m, ", .cmd_flags=");
 	blk_flags_show(m, rq->cmd_flags & ~REQ_OP_MASK, cmd_flag_name,
 		       ARRAY_SIZE(cmd_flag_name));
--
2.22.0


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

* Re: [PATCH] blk-mq: Use seq_puts() in __blk_mq_debugfs_rq_show()
  2019-07-01 19:27 [PATCH] blk-mq: Use seq_puts() in __blk_mq_debugfs_rq_show() Markus Elfring
@ 2019-07-01 19:47 ` Bart Van Assche
  2019-07-01 20:00   ` Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2019-07-01 19:47 UTC (permalink / raw)
  To: Markus Elfring, linux-block, Jens Axboe; +Cc: LKML, kernel-janitors

On 7/1/19 12:27 PM, Markus Elfring wrote:
> A string which did not contain a data format specification should be put
> into a sequence. Thus use the corresponding function “seq_puts”.

"should"? Why should this be done? Or in other words, what is wrong with 
the current code other than that it is slightly verbose and slightly 
slower than seq_puts()? Do you think this matters for debugfs code?

Thanks,

Bart.

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

* Re: blk-mq: Use seq_puts() in __blk_mq_debugfs_rq_show()
  2019-07-01 19:47 ` Bart Van Assche
@ 2019-07-01 20:00   ` Markus Elfring
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2019-07-01 20:00 UTC (permalink / raw)
  To: Bart Van Assche, Jens Axboe, linux-block; +Cc: LKML, kernel-janitors

>> A string which did not contain a data format specification should be put
>> into a sequence. Thus use the corresponding function “seq_puts”.
>
> Why should this be done?

Do you prefer an other wording for the desired data output?


> Or in other words, what is wrong with the current code
> other than that it is slightly verbose and slightly slower than seq_puts()?

I suggest to improve such implementation details also at this place.

Regards,
Markus

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

end of thread, other threads:[~2019-07-01 20:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 19:27 [PATCH] blk-mq: Use seq_puts() in __blk_mq_debugfs_rq_show() Markus Elfring
2019-07-01 19:47 ` Bart Van Assche
2019-07-01 20:00   ` 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).