linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] ar7: replace mac address parsing
@ 2014-06-24 15:39 Daniel Walter
  2014-06-24 15:48 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Walter @ 2014-06-24 15:39 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, linux-kernel

Replace sscanf() with mac_pton().

Signed-off-by: Daniel Walter <dwalter@google.com>
---

 arch/mips/ar7/platform.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c
index 7e2356f..653cbff 100644
--- a/arch/mips/ar7/platform.c
+++ b/arch/mips/ar7/platform.c
@@ -307,10 +307,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
 	}
 
 	if (mac) {
-		if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
-					&dev_addr[0], &dev_addr[1],
-					&dev_addr[2], &dev_addr[3],
-					&dev_addr[4], &dev_addr[5]) != 6) {
+		if (!mac_pton(mac, dev_addr)) {
 			pr_warning("cannot parse mac address, "
 					"using random address\n");
 			eth_random_addr(dev_addr);

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

end of thread, other threads:[~2015-04-01 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-24 15:39 [PATCH 1/1] ar7: replace mac address parsing Daniel Walter
2014-06-24 15:48 ` Joe Perches
2014-06-24 19:26   ` Florian Fainelli
2015-04-01 12:17     ` Jonas Gorski
2015-04-01 15:08       ` Ralf Baechle
2015-04-01 18:05       ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).