* [PATCH] sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-08 16:42 SF Markus Elfring
2017-05-08 17:08 ` Lino Sanfilippo
0 siblings, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-08 16:42 UTC (permalink / raw)
To: netdev, Mirko Lindner, Stephen Hemminger; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 8 May 2017 18:38:17 +0200
A single character (line break) 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>
---
drivers/net/ethernet/marvell/sky2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 1145cde2274a..73575101cd72 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4562,7 +4562,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
seq_printf(seq, "[%d] %#x %d %#x\n",
idx, le->opcode, le->length, le->status);
}
- seq_puts(seq, "\n");
+ seq_putc(seq, '\n');
}
seq_printf(seq, "Tx ring pending=%u...%u report=%d done=%d\n",
--
2.12.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sky2: Use seq_putc() in sky2_debug_show()
2017-05-08 16:42 [PATCH] sky2: Use seq_putc() in sky2_debug_show() SF Markus Elfring
@ 2017-05-08 17:08 ` Lino Sanfilippo
2017-05-08 17:42 ` SF Markus Elfring
0 siblings, 1 reply; 5+ messages in thread
From: Lino Sanfilippo @ 2017-05-08 17:08 UTC (permalink / raw)
To: SF Markus Elfring, netdev, Mirko Lindner, Stephen Hemminger
Cc: LKML, kernel-janitors
Hi,
On 08.05.2017 18:42, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Mon, 8 May 2017 18:38:17 +0200
>
> A single character (line break) should be put into a sequence.
Why?
> Thus use the corresponding function "seq_putc".
>
> This issue was detected by using the Coccinelle software.
Which issue do you mean? I dont see any issue you fix here.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/net/ethernet/marvell/sky2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
> index 1145cde2274a..73575101cd72 100644
> --- a/drivers/net/ethernet/marvell/sky2.c
> +++ b/drivers/net/ethernet/marvell/sky2.c
> @@ -4562,7 +4562,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
> seq_printf(seq, "[%d] %#x %d %#x\n",
> idx, le->opcode, le->length, le->status);
> }
> - seq_puts(seq, "\n");
> + seq_putc(seq, '\n');
> }
>
> seq_printf(seq, "Tx ring pending=%u...%u report=%d done=%d\n",
>
Regards,
Lino
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2: Use seq_putc() in sky2_debug_show()
2017-05-08 17:08 ` Lino Sanfilippo
@ 2017-05-08 17:42 ` SF Markus Elfring
2017-05-09 5:50 ` Stephen Hemminger
0 siblings, 1 reply; 5+ messages in thread
From: SF Markus Elfring @ 2017-05-08 17:42 UTC (permalink / raw)
To: Lino Sanfilippo, netdev
Cc: Mirko Lindner, Stephen Hemminger, LKML, kernel-janitors
> Which issue do you mean? I dont see any issue you fix here.
Are the run time characteristics a bit nicer for the function “seq_putc”
in comparison to the function “seq_puts” for printing a single line break here?
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: sky2: Use seq_putc() in sky2_debug_show()
2017-05-08 17:42 ` SF Markus Elfring
@ 2017-05-09 5:50 ` Stephen Hemminger
2017-05-09 14:26 ` David Laight
0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2017-05-09 5:50 UTC (permalink / raw)
To: SF Markus Elfring
Cc: Lino Sanfilippo, netdev, Mirko Lindner, LKML, kernel-janitors
On Mon, 8 May 2017 19:42:46 +0200
SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> > Which issue do you mean? I dont see any issue you fix here.
>
> Are the run time characteristics a bit nicer for the function “seq_putc”
> in comparison to the function “seq_puts” for printing a single line break here?
>
> Regards,
> Markus
I would put this in why bother category. seq_puts is correct and this is only
in diagnostic output useful to developer and disabled on most distro kernels
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: sky2: Use seq_putc() in sky2_debug_show()
2017-05-09 5:50 ` Stephen Hemminger
@ 2017-05-09 14:26 ` David Laight
0 siblings, 0 replies; 5+ messages in thread
From: David Laight @ 2017-05-09 14:26 UTC (permalink / raw)
To: 'Stephen Hemminger', SF Markus Elfring
Cc: Lino Sanfilippo, netdev, Mirko Lindner, LKML, kernel-janitors
From: Stephen Hemminger
> Sent: 09 May 2017 06:50
> On Mon, 8 May 2017 19:42:46 +0200
> SF Markus Elfring <elfring@users.sourceforge.net> wrote:
>
> > > Which issue do you mean? I dont see any issue you fix here.
> >
> > Are the run time characteristics a bit nicer for the function seq_putc
> > in comparison to the function seq_puts for printing a single line break here?
> >
> > Regards,
> > Markus
>
> I would put this in why bother category. seq_puts is correct and this is only
> in diagnostic output useful to developer and disabled on most distro kernels
Sometimes consistency is best.
Output everything with seq_printf(), using a format "%s" if necessary.
The performance really doesn't matter here at all.
It is also (probably) possible to get gcc to do the conversions - as it does for printf().
(A right PITA for embedded systems where only printf() exists.)
David
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-05-09 14:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-08 16:42 [PATCH] sky2: Use seq_putc() in sky2_debug_show() SF Markus Elfring
2017-05-08 17:08 ` Lino Sanfilippo
2017-05-08 17:42 ` SF Markus Elfring
2017-05-09 5:50 ` Stephen Hemminger
2017-05-09 14:26 ` David Laight
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).