projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f8d271
)
MIPS: AR7: Replace mac address parsing
author
Daniel Walter
<
[email protected]
>
Tue, 24 Jun 2014 15:39:59 +0000
(16:39 +0100)
committer
Ralf Baechle
<
[email protected]
>
Thu, 2 Apr 2015 11:54:22 +0000
(13:54 +0200)
Replace sscanf() with mac_pton().
[
[email protected]
: Resolved conflict.]
Signed-off-by: Daniel Walter <
[email protected]
>
Cc:
[email protected]
Cc:
[email protected]
Patchwork: https://patchwork.linux-mips.org/patch/7151/
Signed-off-by: Ralf Baechle <
[email protected]
>
arch/mips/ar7/platform.c
patch
|
blob
|
history
diff --git
a/arch/mips/ar7/platform.c
b/arch/mips/ar7/platform.c
index af2441dbfc127e5e93c2e07aab8ce2319cb20e5d..be9ff1673ded7f2d20bbffa7897b9ac70dcedb07 100644
(file)
--- 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);
}