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


Groups > linux.kernel > #1638154 > unrolled thread

[PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-09 16:30 +0200
Last post2017-05-10 10:50 +0200
Articles 2 — 2 participants

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 1/4] hamradio: Combine two seq_printf() calls into one in  yam_seq_show() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-09 16:30 +0200
    RE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one  in yam_seq_show() David Laight <David.Laight@ACULAB.COM> - 2017-05-10 10:50 +0200

#1638154 — [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-09 16:30 +0200
Subject[PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()
Message-ID<tFejg-2TS-17@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 May 2017 14:16:45 +0200

A bit of data was 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>
---
 drivers/net/hamradio/yam.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index b6891ada1d7b..542f1e511df1 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -830,8 +830,7 @@ static int yam_seq_show(struct seq_file *seq, void *v)
 	seq_printf(seq, "  RxFrames %lu\n", dev->stats.rx_packets);
 	seq_printf(seq, "  TxInt    %u\n", yp->nb_mdint);
 	seq_printf(seq, "  RxInt    %u\n", yp->nb_rxint);
-	seq_printf(seq, "  RxOver   %lu\n", dev->stats.rx_fifo_errors);
-	seq_printf(seq, "\n");
+	seq_printf(seq, "  RxOver   %lu\n\n", dev->stats.rx_fifo_errors);
 	return 0;
 }
 
-- 
2.12.2

[toc] | [next] | [standalone]


#1638663 — RE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()

FromDavid Laight <David.Laight@ACULAB.COM>
Date2017-05-10 10:50 +0200
SubjectRE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()
Message-ID<tFvtM-6TH-21@gated-at.bofh.it>
In reply to#1638154
From: SF Markus Elfring
> Sent: 09 May 2017 15:22
> A bit of data was 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>
> ---
>  drivers/net/hamradio/yam.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
> index b6891ada1d7b..542f1e511df1 100644
> --- a/drivers/net/hamradio/yam.c
> +++ b/drivers/net/hamradio/yam.c
> @@ -830,8 +830,7 @@ static int yam_seq_show(struct seq_file *seq, void *v)
>  	seq_printf(seq, "  RxFrames %lu\n", dev->stats.rx_packets);
>  	seq_printf(seq, "  TxInt    %u\n", yp->nb_mdint);
>  	seq_printf(seq, "  RxInt    %u\n", yp->nb_rxint);
> -	seq_printf(seq, "  RxOver   %lu\n", dev->stats.rx_fifo_errors);
> -	seq_printf(seq, "\n");
> +	seq_printf(seq, "  RxOver   %lu\n\n", dev->stats.rx_fifo_errors);
>  	return 0;

The code was consistently (and probably deliberately) using one seq_printf()
call for each line so that the source looks 'a bit like' the output.

These changes are all stupid.

	David

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web