lkml.org 
[lkml]   [2017]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/3] sctp: Replace six seq_printf() calls by seq_putc()
From
Date
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
\
 
 \ /
  Last update: 2017-05-01 15:33    [W:0.040 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site