net-procfs: Adjust buffer output in dev_mc_seq_show()
Subsystems (3)
PATCH 1/1 net-procfs: Adjust buffer output in dev_mc_seq_show()
From: Markus Elfring <[email protected]>
Date: Wed, 10 May 2017 21:17:43 +0200
* Use a special format string specification for the desired output of the array "addr" into a sequence.
This issue was detected by using the Coccinelle software.
* Delete the local variable "i" and a call of the function "seq_putc" which became unnecessary with this refactoring.
Signed-off-by Markus Elfring <[email protected]>
--- net/core/net-procfs.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
net/core/net-procfs.c +1 -7
@@ -363,15 +363,9 @@ 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,"%*phN\n" , dev->addr_len, ha->addr); }netif_addr_unlock_bh (dev);return 0 ;
Signature · 1 line
2.12.3