diff options
-rw-r--r-- | drivers/net/ksz884x.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c index b3c010b85658..8b32cc107f0f 100644 --- a/drivers/net/ksz884x.c +++ b/drivers/net/ksz884x.c | |||
@@ -6894,13 +6894,12 @@ static void get_mac_addr(struct dev_info *hw_priv, u8 *macaddr, int port) | |||
6894 | i = j = num = got_num = 0; | 6894 | i = j = num = got_num = 0; |
6895 | while (j < MAC_ADDR_LEN) { | 6895 | while (j < MAC_ADDR_LEN) { |
6896 | if (macaddr[i]) { | 6896 | if (macaddr[i]) { |
6897 | int digit; | ||
6898 | |||
6897 | got_num = 1; | 6899 | got_num = 1; |
6898 | if ('0' <= macaddr[i] && macaddr[i] <= '9') | 6900 | digit = hex_to_bin(macaddr[i]); |
6899 | num = num * 16 + macaddr[i] - '0'; | 6901 | if (digit >= 0) |
6900 | else if ('A' <= macaddr[i] && macaddr[i] <= 'F') | 6902 | num = num * 16 + digit; |
6901 | num = num * 16 + 10 + macaddr[i] - 'A'; | ||
6902 | else if ('a' <= macaddr[i] && macaddr[i] <= 'f') | ||
6903 | num = num * 16 + 10 + macaddr[i] - 'a'; | ||
6904 | else if (':' == macaddr[i]) | 6903 | else if (':' == macaddr[i]) |
6905 | got_num = 2; | 6904 | got_num = 2; |
6906 | else | 6905 | else |