From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-sctp@vger.kernel.org, netdev@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Neil Horman <nhorman@tuxdriver.com>,
Vlad Yasevich <vyasevich@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 2/3] sctp: Combine two seq_printf() calls into one call in sctp_remaddr_seq_show()
Date: Mon, 1 May 2017 15:32:31 +0200 [thread overview]
Message-ID: <856b4c28-d620-38cd-a442-f2fcafd42034@users.sourceforge.net> (raw)
In-Reply-To: <ea9206ca-2a2f-095e-d764-3f819610d5e8@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 1 May 2017 14:24:34 +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>
---
net/sctp/proc.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 1cf4b6385418..458087681490 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -475,9 +475,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
* The current state of this destination. I.e.
* SCTP_ACTIVE, SCTP_INACTIVE, ...
*/
- seq_printf(seq, "%d", tsp->state);
-
- seq_printf(seq, "\n");
+ seq_printf(seq, "%d\n", tsp->state);
}
sctp_transport_put(transport);
--
2.12.2
next prev parent reply other threads:[~2017-05-01 13:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-01 13:30 [PATCH 0/3] net-SCTP: Fine-tuning for six function implementations SF Markus Elfring
2017-05-01 13:31 ` [PATCH 1/3] sctp: Replace six seq_printf() calls by seq_putc() SF Markus Elfring
2017-05-01 13:32 ` SF Markus Elfring [this message]
2017-05-01 13:33 ` [PATCH 3/3] sctp: Replace four seq_printf() calls by seq_puts() SF Markus Elfring
2017-05-02 13:15 ` [PATCH 0/3] net-SCTP: Fine-tuning for six function implementations Neil Horman
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=856b4c28-d620-38cd-a442-f2fcafd42034@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.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).