X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fstaging%2Frtl8188eu%2Fcore%2Frtw_ieee80211.c;h=742b29c590df92a676732341db82c7984ab6e3aa;hb=e09b41010ba33a20a87472ee821fa407a5b8da36;hp=11b780d6c4ab6bbea68e8ccdb60ba1ba800840b2;hpb=9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00;p=kvmfornfv.git diff --git a/kernel/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/kernel/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 11b780d6c..742b29c59 100644 --- a/kernel/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/kernel/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -19,6 +19,8 @@ ******************************************************************************/ #define _IEEE80211_C +#include + #include #include #include @@ -128,12 +130,12 @@ int rtw_check_network_type(unsigned char *rate, int ratelen, int channel) } } -u8 *rtw_set_fixed_ie(unsigned char *pbuf, unsigned int len, unsigned char *source, - unsigned int *frlen) +u8 *rtw_set_fixed_ie(void *pbuf, unsigned int len, void *source, + unsigned int *frlen) { - memcpy((void *)pbuf, (void *)source, len); + memcpy(pbuf, source, len); *frlen = *frlen + len; - return pbuf + len; + return ((u8 *)pbuf) + len; } /* rtw_set_ie will update frame length */ @@ -1042,7 +1044,7 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, elems->timeout_int = pos; elems->timeout_int_len = elen; break; - case WLAN_EID_HT_CAP: + case WLAN_EID_HT_CAPABILITY: elems->ht_capabilities = pos; elems->ht_capabilities_len = elen; break; @@ -1101,7 +1103,7 @@ void rtw_macaddr_cfg(u8 *mac_addr) void dump_ies(u8 *buf, u32 buf_len) { - u8 *pos = (u8 *)buf; + u8 *pos = buf; u8 id, len; while (pos-buf <= buf_len) { @@ -1117,7 +1119,7 @@ void dump_ies(u8 *buf, u32 buf_len) void dump_wps_ie(u8 *ie, u32 ie_len) { - u8 *pos = (u8 *)ie; + u8 *pos = ie; u16 id; u16 len; u8 *wps_ie; @@ -1390,6 +1392,6 @@ static const char *_action_public_str[] = { const char *action_public_str(u8 action) { - action = (action >= ACT_PUBLIC_MAX) ? ACT_PUBLIC_MAX : action; + action = min_t(u8, action, ACT_PUBLIC_MAX); return _action_public_str[action]; }