From 5db7ccdc9f685fd742cc32efe58aa0c036f380b9 Mon Sep 17 00:00:00 2001 From: Daniel Walter Date: Tue, 24 Jun 2014 16:39:59 +0100 Subject: [PATCH] MIPS: AR7: Replace mac address parsing Replace sscanf() with mac_pton(). [ralf@linux-mips.org: Resolved conflict.] Signed-off-by: Daniel Walter Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7151/ Signed-off-by: Ralf Baechle --- 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 af2441dbfc12..be9ff1673ded 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_warn("cannot parse mac address, using random address\n"); eth_random_addr(dev_addr); } -- GitLab