Skip to contentSkip to conversation

ARM: orion5x: Use vsprintf %pM extension

PATCH In review Joe Perches 3 participants 3 messages Jun 15, 2015 – Jun 17, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: orion5x: Use vsprintf %pM extension

Format mac addresses with the normal kernel extension.

---
 arch/arm/mach-orion5x/dns323-setup.c | 4 +---
 arch/arm/mach-orion5x/tsx09-common.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-orion5x/dns323-setup.c +1 -3
index 09d2a26..f267e58 100644
@@ -236,9 +236,7 @@ static int __init dns323_read_mac_addr(void)
 	}
 
 	iounmap(mac_page);
-	printk("DNS-323: Found ethernet MAC address: ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk("DNS-323: Found ethernet MAC address: %pM\n", addr);
 
 	memcpy(dns323_eth_data.mac_addr, addr, 6);
 
arch/arm/mach-orion5x/tsx09-common.c +1 -3
index 7189827..24b2959 100644
@@ -101,9 +101,7 @@ static int __init qnap_tsx09_check_mac_addr(const char *addr_str)
 		addr[i] = byte;
 	}
 
-	printk(KERN_INFO "tsx09: found ethernet mac address ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr);
 
 	memcpy(qnap_tsx09_eth_data.mac_addr, addr, 6);
 
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Joe Perches

Format mac addresses with the normal kernel extension.

Andrew

Quoted 37 lines
---
 arch/arm/mach-orion5x/dns323-setup.c | 4 +---
 arch/arm/mach-orion5x/tsx09-common.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-orion5x/dns323-setup.c +1 -3
index 09d2a26..f267e58 100644
@@ -236,9 +236,7 @@ static int __init dns323_read_mac_addr(void)
 	}
 
 	iounmap(mac_page);
-	printk("DNS-323: Found ethernet MAC address: ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk("DNS-323: Found ethernet MAC address: %pM\n", addr);
 
 	memcpy(dns323_eth_data.mac_addr, addr, 6);
 
arch/arm/mach-orion5x/tsx09-common.c +1 -3
index 7189827..24b2959 100644
@@ -101,9 +101,7 @@ static int __init qnap_tsx09_check_mac_addr(const char *addr_str)
 		addr[i] = byte;
 	}
 
-	printk(KERN_INFO "tsx09: found ethernet mac address ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr);
 
 	memcpy(qnap_tsx09_eth_data.mac_addr, addr, 6);
 
#2 lore raw

Hi Andrew, Joe,

Quoted 6 lines · Andrew Lunn
Quoted 3 lines · Joe Perches

Format mac addresses with the normal kernel extension.

applied on mvebu/cleanup-4.3

Thanks,

Gregory

Quoted 40 lines

Andrew

Quoted 37 lines
---
 arch/arm/mach-orion5x/dns323-setup.c | 4 +---
 arch/arm/mach-orion5x/tsx09-common.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-orion5x/dns323-setup.c +1 -3
index 09d2a26..f267e58 100644
@@ -236,9 +236,7 @@ static int __init dns323_read_mac_addr(void)
 	}
 
 	iounmap(mac_page);
-	printk("DNS-323: Found ethernet MAC address: ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk("DNS-323: Found ethernet MAC address: %pM\n", addr);
 
 	memcpy(dns323_eth_data.mac_addr, addr, 6);
 
arch/arm/mach-orion5x/tsx09-common.c +1 -3
index 7189827..24b2959 100644
@@ -101,9 +101,7 @@ static int __init qnap_tsx09_check_mac_addr(const char *addr_str)
 		addr[i] = byte;
 	}
 
-	printk(KERN_INFO "tsx09: found ethernet mac address ");
-	for (i = 0; i < 6; i++)
-		printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
+	printk(KERN_INFO "tsx09: found ethernet mac address %pM\n", addr);
 
 	memcpy(qnap_tsx09_eth_data.mac_addr, addr, 6);
 
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com