提交 5db7ccdc 编写于 作者: D Daniel Walter 提交者: Ralf Baechle

MIPS: AR7: Replace mac address parsing

Replace sscanf() with mac_pton().

[ralf@linux-mips.org: Resolved conflict.]
Signed-off-by: NDaniel 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: NRalf Baechle <ralf@linux-mips.org>
上级 1f8d2713
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册