mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: "'SF Markus Elfring'" <elfring@users.sourceforge.net>,
	"linux-hams@vger.kernel.org" <linux-hams@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Jean-Paul Roubelat <jpr@f6fbb.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"kernel-janitors@vger.kernel.org"
	<kernel-janitors@vger.kernel.org>
Subject: RE: [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show()
Date: Wed, 10 May 2017 08:48:13 +0000	[thread overview]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6DCFFE852F@AcuExch.aculab.com> (raw)
In-Reply-To: <c2866b46-28c9-f17f-dce7-96425a17a43a@users.sourceforge.net>

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

  reply	other threads:[~2017-05-10  8:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 14:21 [PATCH 0/4] hamradio: Fine-tuning for nine function implementations SF Markus Elfring
2017-05-09 14:22 ` [PATCH 1/4] hamradio: Combine two seq_printf() calls into one in yam_seq_show() SF Markus Elfring
2017-05-10  8:48   ` David Laight [this message]
2017-05-09 14:23 ` [PATCH 2/4] hamradio: Adjust four function calls together with a variable assignment SF Markus Elfring
2017-05-09 14:24 ` [PATCH 3/4] hamradio: Use seq_puts() in bpq_seq_show() SF Markus Elfring
2017-05-09 14:25 ` [PATCH 4/4] hamradio: Adjust four function calls together with a variable assignment SF Markus Elfring
2017-05-09 14:43 ` [PATCH 0/4] hamradio: Fine-tuning for nine function implementations David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=063D6719AE5E284EB5DD2968C1650D6DCFFE852F@AcuExch.aculab.com \
    --to=david.laight@aculab.com \
    --cc=davem@davemloft.net \
    --cc=elfring@users.sourceforge.net \
    --cc=javier@osg.samsung.com \
    --cc=jpr@f6fbb.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®