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 1/3] sctp: Replace six seq_printf() calls by seq_putc()
Date: Mon, 1 May 2017 15:31:38 +0200 [thread overview]
Message-ID: <a22ad66a-ffe1-b772-8151-8b389aa2c94b@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:18:52 +0200
Six single characters 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>
---
net/sctp/proc.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index a0b29d43627f..1cf4b6385418 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -149,9 +149,8 @@ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_commo
addr = &laddr->a;
af = sctp_get_af_specific(addr->sa.sa_family);
- if (primary && af->cmp_addr(addr, primary)) {
- seq_printf(seq, "*");
- }
+ if (primary && af->cmp_addr(addr, primary))
+ seq_putc(seq, '*');
af->seq_dump_addr(seq, addr);
}
rcu_read_unlock();
@@ -170,9 +169,8 @@ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_associa
addr = &transport->ipaddr;
af = sctp_get_af_specific(addr->sa.sa_family);
- if (af->cmp_addr(addr, primary)) {
- seq_printf(seq, "*");
- }
+ if (af->cmp_addr(addr, primary))
+ seq_putc(seq, '*');
af->seq_dump_addr(seq, addr);
}
}
@@ -232,7 +230,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
sock_i_ino(sk));
sctp_seq_dump_local_addrs(seq, epb);
- seq_printf(seq, "\n");
+ seq_putc(seq, '\n');
}
read_unlock(&head->lock);
local_bh_enable();
@@ -355,5 +353,5 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
sock_i_ino(sk),
epb->bind_addr.port,
assoc->peer.port);
- seq_printf(seq, " ");
+ seq_putc(seq, ' ');
sctp_seq_dump_local_addrs(seq, epb);
@@ -369,8 +367,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
sk->sk_wmem_queued,
sk->sk_sndbuf,
sk->sk_rcvbuf);
- seq_printf(seq, "\n");
-
+ seq_putc(seq, '\n');
sctp_transport_put(transport);
return 0;
@@ -438,7 +435,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
* The remote address (ADDR)
*/
tsp->af_specific->seq_dump_addr(seq, &tsp->ipaddr);
- seq_printf(seq, " ");
+ seq_putc(seq, ' ');
/*
* The association ID (ASSOC_ID)
*/
--
2.12.2
next prev parent reply other threads:[~2017-05-01 13:32 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 ` SF Markus Elfring [this message]
2017-05-01 13:32 ` [PATCH 2/3] sctp: Combine two seq_printf() calls into one call in sctp_remaddr_seq_show() SF Markus Elfring
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=a22ad66a-ffe1-b772-8151-8b389aa2c94b@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).