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

MIPS: AR7: Replace mac address parsing

Replace sscanf() with mac_pton().

[ralf@linux-mips.org: Resolved conflict.]

Signed-off-by: Daniel Walter <dwalter@google.com>
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 <ralf@linux-mips.org>

authored by

Daniel Walter and committed by
Ralf Baechle
5db7ccdc 1f8d2713

+1 -4
+1 -4
arch/mips/ar7/platform.c
··· 307 307 } 308 308 309 309 if (mac) { 310 - if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", 311 - &dev_addr[0], &dev_addr[1], 312 - &dev_addr[2], &dev_addr[3], 313 - &dev_addr[4], &dev_addr[5]) != 6) { 310 + if (!mac_pton(mac, dev_addr)) { 314 311 pr_warn("cannot parse mac address, using random address\n"); 315 312 eth_random_addr(dev_addr); 316 313 }