aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2013-11-14 17:31:57 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-14 19:32:20 -0500
commit652586df95e5d76b37d07a11839126dcfede1621 (patch)
treee3a668265cade256302830ea3ff8b3699ab2977e /net/ipv4/udp.c
parent839cc2a94cc3665bafe32203c2f095f4dd470a80 (diff)
seq_file: remove "%n" usage from seq_file users
All seq_printf() users are using "%n" for calculating padding size, convert them to use seq_setwidth() / seq_pad() pair. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Kees Cook <keescook@chromium.org> Cc: Joe Perches <joe@perches.com> Cc: David Miller <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net/ipv4/udp.c')
-rw-r--r--net/ipv4/udp.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 89909dd730dd..de86e5bc4462 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2331,7 +2331,7 @@ EXPORT_SYMBOL(udp_proc_unregister);
2331 2331
2332/* ------------------------------------------------------------------------ */ 2332/* ------------------------------------------------------------------------ */
2333static void udp4_format_sock(struct sock *sp, struct seq_file *f, 2333static void udp4_format_sock(struct sock *sp, struct seq_file *f,
2334 int bucket, int *len) 2334 int bucket)
2335{ 2335{
2336 struct inet_sock *inet = inet_sk(sp); 2336 struct inet_sock *inet = inet_sk(sp);
2337 __be32 dest = inet->inet_daddr; 2337 __be32 dest = inet->inet_daddr;
@@ -2340,7 +2340,7 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
2340 __u16 srcp = ntohs(inet->inet_sport); 2340 __u16 srcp = ntohs(inet->inet_sport);
2341 2341
2342 seq_printf(f, "%5d: %08X:%04X %08X:%04X" 2342 seq_printf(f, "%5d: %08X:%04X %08X:%04X"
2343 " %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d%n", 2343 " %02X %08X:%08X %02X:%08lX %08X %5u %8d %lu %d %pK %d",
2344 bucket, src, srcp, dest, destp, sp->sk_state, 2344 bucket, src, srcp, dest, destp, sp->sk_state,
2345 sk_wmem_alloc_get(sp), 2345 sk_wmem_alloc_get(sp),
2346 sk_rmem_alloc_get(sp), 2346 sk_rmem_alloc_get(sp),
@@ -2348,23 +2348,22 @@ static void udp4_format_sock(struct sock *sp, struct seq_file *f,
2348 from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)), 2348 from_kuid_munged(seq_user_ns(f), sock_i_uid(sp)),
2349 0, sock_i_ino(sp), 2349 0, sock_i_ino(sp),
2350 atomic_read(&sp->sk_refcnt), sp, 2350 atomic_read(&sp->sk_refcnt), sp,
2351 atomic_read(&sp->sk_drops), len); 2351 atomic_read(&sp->sk_drops));
2352} 2352}
2353 2353
2354int udp4_seq_show(struct seq_file *seq, void *v) 2354int udp4_seq_show(struct seq_file *seq, void *v)
2355{ 2355{
2356 seq_setwidth(seq, 127);
2356 if (v == SEQ_START_TOKEN) 2357 if (v == SEQ_START_TOKEN)
2357 seq_printf(seq, "%-127s\n", 2358 seq_puts(seq, " sl local_address rem_address st tx_queue "
2358 " sl local_address rem_address st tx_queue "
2359 "rx_queue tr tm->when retrnsmt uid timeout " 2359 "rx_queue tr tm->when retrnsmt uid timeout "
2360 "inode ref pointer drops"); 2360 "inode ref pointer drops");
2361 else { 2361 else {
2362 struct udp_iter_state *state = seq->private; 2362 struct udp_iter_state *state = seq->private;
2363 int len;
2364 2363
2365 udp4_format_sock(v, seq, state->bucket, &len); 2364 udp4_format_sock(v, seq, state->bucket);
2366 seq_printf(seq, "%*s\n", 127 - len, "");
2367 } 2365 }
2366 seq_pad(seq, '\n');
2368 return 0; 2367 return 0;
2369} 2368}
2370 2369