mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
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>
This commit is contained in:
parent
1f8d271385
commit
5db7ccdc9f
@ -307,10 +307,7 @@ static void __init cpmac_get_mac(int instance, unsigned char *dev_addr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mac) {
|
if (mac) {
|
||||||
if (sscanf(mac, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx",
|
if (!mac_pton(mac, dev_addr)) {
|
||||||
&dev_addr[0], &dev_addr[1],
|
|
||||||
&dev_addr[2], &dev_addr[3],
|
|
||||||
&dev_addr[4], &dev_addr[5]) != 6) {
|
|
||||||
pr_warn("cannot parse mac address, using random address\n");
|
pr_warn("cannot parse mac address, using random address\n");
|
||||||
eth_random_addr(dev_addr);
|
eth_random_addr(dev_addr);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user