summaryrefslogtreecommitdiffstats
path: root/net/core/net-procfs.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2017-06-02 11:40:44 +0200
committerDavid S. Miller <davem@davemloft.net>2017-06-05 01:52:58 +0200
commitfbd0ac60420fa2f5d45865326ad1074b80f29060 (patch)
treeb2cb3b104dbcd2f16fa6b4e106105278d45c1223 /net/core/net-procfs.c
parentmdio: mux: make child bus walking more permissive and errors more verbose (diff)
downloadlinux-fbd0ac60420fa2f5d45865326ad1074b80f29060.tar.xz
linux-fbd0ac60420fa2f5d45865326ad1074b80f29060.zip
net-procfs: Use vsnprintf extension %phN
Save a bit of code by using the kernel extension. $ size net/core/net-procfs.o* text data bss dec hex filename 3701 120 0 3821 eed net/core/net-procfs.o.new 3764 120 0 3884 f2c net/core/net-procfs.o.old Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/net-procfs.c')
-rw-r--r--net/core/net-procfs.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
index 14d09345f00d..4847964931df 100644
--- a/net/core/net-procfs.c
+++ b/net/core/net-procfs.c
@@ -363,15 +363,10 @@ static int dev_mc_seq_show(struct seq_file *seq, void *v)
netif_addr_lock_bh(dev);
netdev_for_each_mc_addr(ha, dev) {
- int i;
-
- seq_printf(seq, "%-4d %-15s %-5d %-5d ", dev->ifindex,
- dev->name, ha->refcount, ha->global_use);
-
- for (i = 0; i < dev->addr_len; i++)
- seq_printf(seq, "%02x", ha->addr[i]);
-
- seq_putc(seq, '\n');
+ seq_printf(seq, "%-4d %-15s %-5d %-5d %*phN\n",
+ dev->ifindex, dev->name,
+ ha->refcount, ha->global_use,
+ (int)dev->addr_len, ha->addr);
}
netif_addr_unlock_bh(dev);
return 0;