From: Jes Sorensen Date: Sat, 26 Apr 2014 16:55:07 +0000 (+0200) Subject: staging: rtl8723au: rtw_joinbss_cmd23a(): Remove unnecessary typecast X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~1207 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ea4190b163fb4ff918d64f21e000cab038e9f41e;p=firefly-linux-kernel-4.4.55.git staging: rtl8723au: rtw_joinbss_cmd23a(): Remove unnecessary typecast and remove use-once variable t_len. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c b/drivers/staging/rtl8723au/core/rtw_cmd.c index 508576ef1eb2..9e0a5ea9ba75 100644 --- a/drivers/staging/rtl8723au/core/rtw_cmd.c +++ b/drivers/staging/rtl8723au/core/rtw_cmd.c @@ -530,10 +530,9 @@ exit: } u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, - struct wlan_network * pnetwork) + struct wlan_network *pnetwork) { u8 *auth, res = _SUCCESS; - uint t_len = 0; struct wlan_bssid_ex *psecnetwork; struct cmd_obj *pcmd; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; @@ -567,8 +566,6 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, "fail!!!\n")); goto exit; } - /* for IEs is fix buf size */ - t_len = sizeof(struct wlan_bssid_ex); /* for hidden ap to set fw_state here */ if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE)) { @@ -586,7 +583,7 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, } } - psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss; + psecnetwork = &psecuritypriv->sec_bss; if (!psecnetwork) { if (pcmd) kfree(pcmd); @@ -599,7 +596,7 @@ u8 rtw_joinbss_cmd23a(struct rtw_adapter *padapter, goto exit; } - memset(psecnetwork, 0, t_len); + memset(psecnetwork, 0, sizeof(struct wlan_bssid_ex)); memcpy(psecnetwork, &pnetwork->network, get_wlan_bssid_ex_sz(&pnetwork->network));