Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hsr: Use %pM format specifier for MAC addresses

Convert to %pM instead of using custom code.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andy Shevchenko and committed by
David S. Miller
cc0b065f fdc22981

+2 -8
+2 -8
net/hsr/hsr_debugfs.c
··· 22 22 23 23 static struct dentry *hsr_debugfs_root_dir; 24 24 25 - static void print_mac_address(struct seq_file *sfp, unsigned char *mac) 26 - { 27 - seq_printf(sfp, "%02x:%02x:%02x:%02x:%02x:%02x ", 28 - mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 29 - } 30 - 31 25 /* hsr_node_table_show - Formats and prints node_table entries */ 32 26 static int 33 27 hsr_node_table_show(struct seq_file *sfp, void *data) ··· 43 49 /* skip self node */ 44 50 if (hsr_addr_is_self(priv, node->macaddress_A)) 45 51 continue; 46 - print_mac_address(sfp, &node->macaddress_A[0]); 47 - print_mac_address(sfp, &node->macaddress_B[0]); 52 + seq_printf(sfp, "%pM ", &node->macaddress_A[0]); 53 + seq_printf(sfp, "%pM ", &node->macaddress_B[0]); 48 54 seq_printf(sfp, "%10lx, ", node->time_in[HSR_PT_SLAVE_A]); 49 55 seq_printf(sfp, "%10lx, ", node->time_in[HSR_PT_SLAVE_B]); 50 56 seq_printf(sfp, "%14x, ", node->addr_B_port);