All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net-procfs: Use vsnprintf extension %phN
@ 2017-06-02  9:40 Joe Perches
  2017-06-04 23:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Joe Perches @ 2017-06-02  9:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: David S. Miller, netdev

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>
---
 net/core/net-procfs.c | 13 ++++---------
 1 file 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;
-- 
2.10.0.rc2.1.g053435c

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net-procfs: Use vsnprintf extension %phN
  2017-06-02  9:40 [PATCH] net-procfs: Use vsnprintf extension %phN Joe Perches
@ 2017-06-04 23:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-06-04 23:53 UTC (permalink / raw)
  To: joe; +Cc: linux-kernel, netdev

From: Joe Perches <joe@perches.com>
Date: Fri,  2 Jun 2017 02:40:44 -0700

> 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>

Applied, thanks Joe.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-04 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-02  9:40 [PATCH] net-procfs: Use vsnprintf extension %phN Joe Perches
2017-06-04 23:53 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.