Skip to content

Commit cc0b065

Browse files
andy-shevdavem330
authored andcommitted
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>
1 parent fdc2298 commit cc0b065

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

‎net/hsr/hsr_debugfs.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@
2222

2323
static struct dentry *hsr_debugfs_root_dir;
2424

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-
3125
/* hsr_node_table_show - Formats and prints node_table entries */
3226
static int
3327
hsr_node_table_show(struct seq_file *sfp, void *data)
@@ -49,8 +43,8 @@ hsr_node_table_show(struct seq_file *sfp, void *data)
4943
/* skip self node */
5044
if (hsr_addr_is_self(priv, node->macaddress_A))
5145
continue;
52-
print_mac_address(sfp, &node->macaddress_A[0]);
53-
print_mac_address(sfp, &node->macaddress_B[0]);
46+
seq_printf(sfp, "%pM ", &node->macaddress_A[0]);
47+
seq_printf(sfp, "%pM ", &node->macaddress_B[0]);
5448
seq_printf(sfp, "%10lx, ", node->time_in[HSR_PT_SLAVE_A]);
5549
seq_printf(sfp, "%10lx, ", node->time_in[HSR_PT_SLAVE_B]);
5650
seq_printf(sfp, "%14x, ", node->addr_B_port);

0 commit comments

Comments
 (0)