diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-07-10 03:41:22 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-10 04:07:44 (GMT) |
commit | 57373690dba28abf483cc62da0963e9e990f3657 (patch) | |
tree | 6c780dd11bb245e744e8fe39f85c7df70af5317e | |
parent | 529a929912ac9b23faa243ee624e2177f13e0774 (diff) | |
download | linux-57373690dba28abf483cc62da0963e9e990f3657.tar.xz |
staging: rtl8188eu: re-use hex_to_bin() instead of custom code
hex_to_bin could be used to convert hexdecimal digit to its binary
representation.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 17 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/include/wlan_bssdef.h | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 6 |
3 files changed, 3 insertions, 23 deletions
diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 02bd3b0..a375b75 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -1067,23 +1067,6 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, return unknown ? ParseUnknown : ParseOK; } -u8 key_char2num(u8 ch) -{ - if ((ch >= '0') && (ch <= '9')) - return ch - '0'; - else if ((ch >= 'a') && (ch <= 'f')) - return ch - 'a' + 10; - else if ((ch >= 'A') && (ch <= 'F')) - return ch - 'A' + 10; - else - return 0xff; -} - -u8 str_2char2num(u8 hch, u8 lch) -{ - return (key_char2num(hch) * 10) + key_char2num(lch); -} - void rtw_macaddr_cfg(u8 *mac_addr) { u8 mac[ETH_ALEN]; diff --git a/drivers/staging/rtl8188eu/include/wlan_bssdef.h b/drivers/staging/rtl8188eu/include/wlan_bssdef.h index 85e4b92..53b1bd8 100644 --- a/drivers/staging/rtl8188eu/include/wlan_bssdef.h +++ b/drivers/staging/rtl8188eu/include/wlan_bssdef.h @@ -340,7 +340,4 @@ struct ndis_802_11_cap { struct ndis_802_11_auth_encrypt AuthenticationEncryptionSupported[1]; }; -u8 key_char2num(u8 ch); -u8 str_2char2num(u8 hch, u8 lch); - #endif /* ifndef WLAN_BSSDEF_H_ */ diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 6402f48..78ab270 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -2697,7 +2697,7 @@ static int rtw_p2p_set_intent(struct net_device *dev, intent = extra[0] - '0'; break; case 2: - intent = str_2char2num(extra[0], extra[1]); + intent = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]); break; } if (intent <= 15) @@ -2722,7 +2722,7 @@ static int rtw_p2p_set_listen_ch(struct net_device *dev, listen_ch = extra[0] - '0'; break; case 2: - listen_ch = str_2char2num(extra[0], extra[1]); + listen_ch = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]); break; } @@ -2755,7 +2755,7 @@ static int rtw_p2p_set_op_ch(struct net_device *dev, op_ch = extra[0] - '0'; break; case 2: - op_ch = str_2char2num(extra[0], extra[1]); + op_ch = hex_to_bin(extra[0]) * 10 + hex_to_bin(extra[1]); break; } |