Skip to content

Commit

Permalink
net-procfs: Use vsnprintf extension %phN
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and David S. Miller committed Jun 4, 2017
1 parent 342fa19 commit fbd0ac6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions net/core/net-procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fbd0ac6

Please sign in to comment.