netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: netdev@vger.kernel.org,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/4] net: stmmac: Combine three seq_printf() calls into a seq_puts() in stmmac_sysfs_dma_cap_read()
Date: Tue, 9 May 2017 13:52:54 +0200	[thread overview]
Message-ID: <22603603-758e-ed97-6d39-0af8c2ce9cd6@users.sourceforge.net> (raw)
In-Reply-To: <aa58027a-a39c-963e-4376-a4d5312ee118@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 May 2017 13:10:28 +0200

A bit of text was put into a sequence by three 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/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cd8c60132390..2949c9fc18fa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3802,10 +3802,10 @@ static int stmmac_sysfs_dma_cap_read(struct seq_file *seq, void *v)
 		return 0;
 	}
 
-	seq_printf(seq, "==============================\n");
-	seq_printf(seq, "\tDMA HW features\n");
-	seq_printf(seq, "==============================\n");
-
+	seq_puts(seq,
+		 "==============================\n"
+		 "\tDMA HW features\n"
+		 "==============================\n");
 	seq_printf(seq, "\t10/100 Mbps: %s\n",
 		   (priv->dma_cap.mbps_10_100) ? "Y" : "N");
 	seq_printf(seq, "\t1000 Mbps: %s\n",
-- 
2.12.2

  reply	other threads:[~2017-05-09 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 11:51 [PATCH 0/4] net: stmmac: Fine-tuning for four function implementations SF Markus Elfring
2017-05-09 11:52 ` SF Markus Elfring [this message]
2017-05-09 11:53 ` [PATCH 2/4] net: stmmac: Replace five seq_printf() calls by seq_puts() SF Markus Elfring
2017-05-09 11:54 ` [PATCH 3/4] net: stmmac: Use seq_putc() in sysfs_display_ring() SF Markus Elfring
2017-05-09 11:55 ` [PATCH 4/4] net: stmmac: Delete an unnecessary return statement in stmmac_get_tx_hwtstamp() SF Markus Elfring
2017-05-10  6:56 ` [PATCH 0/4] net: stmmac: Fine-tuning for four function implementations Giuseppe CAVALLARO

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=22603603-758e-ed97-6d39-0af8c2ce9cd6@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=alexandre.torgue@st.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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;
as well as URLs for NNTP newsgroup(s).