* [PATCH] sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-08 16:42 ` SF Markus Elfring
0 siblings, 0 replies; 10+ 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] 10+ messages in thread
* [PATCH] sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-08 16:42 ` SF Markus Elfring
0 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: [PATCH] sky2: Use seq_putc() in sky2_debug_show()
2017-05-08 16:42 ` SF Markus Elfring
@ 2017-05-08 17:08 ` Lino Sanfilippo
-1 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: [PATCH] sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-08 17:08 ` Lino Sanfilippo
0 siblings, 0 replies; 10+ 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] 10+ 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
-1 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-08 17:42 ` SF Markus Elfring
0 siblings, 0 replies; 10+ 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] 10+ 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
-1 siblings, 0 replies; 10+ 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] 10+ messages in thread
* Re: sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-09 5:50 ` Stephen Hemminger
0 siblings, 0 replies; 10+ 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] 10+ 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
-1 siblings, 0 replies; 10+ 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] 10+ messages in thread
* RE: sky2: Use seq_putc() in sky2_debug_show()
@ 2017-05-09 14:26 ` David Laight
0 siblings, 0 replies; 10+ 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
RnJvbTogU3RlcGhlbiBIZW1taW5nZXINCj4gU2VudDogMDkgTWF5IDIwMTcgMDY6NTANCj4gT24g
TW9uLCA4IE1heSAyMDE3IDE5OjQyOjQ2ICswMjAwDQo+IFNGIE1hcmt1cyBFbGZyaW5nIDxlbGZy
aW5nQHVzZXJzLnNvdXJjZWZvcmdlLm5ldD4g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+ messages in thread
end of thread, other threads:[~2017-05-09 14:27 UTC | newest]
Thread overview: 10+ 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 16:42 ` SF Markus Elfring
2017-05-08 17:08 ` Lino Sanfilippo
2017-05-08 17:08 ` Lino Sanfilippo
2017-05-08 17:42 ` SF Markus Elfring
2017-05-08 17:42 ` SF Markus Elfring
2017-05-09 5:50 ` Stephen Hemminger
2017-05-09 5:50 ` Stephen Hemminger
2017-05-09 14:26 ` David Laight
2017-05-09 14:26 ` David Laight
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.