]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: r8188eu: remove unnecessary type casts (struct wlan_bssid_ex *)
authorIvan Safonov <insafonov@gmail.com>
Sun, 4 Oct 2020 06:09:22 +0000 (09:09 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Oct 2020 07:59:46 +0000 (09:59 +0200)
Reduce line length, simplify refactoring.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Link: https://lore.kernel.org/r/20201004060921.8908-1-insafonov@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c
drivers/staging/rtl8188eu/core/rtw_cmd.c
drivers/staging/rtl8188eu/core/rtw_mlme.c
drivers/staging/rtl8188eu/core/rtw_mlme_ext.c
drivers/staging/rtl8188eu/core/rtw_wlan_util.c

index 41535441f82c7a448001c08419545d866f5e8b56..2078d87055bf6b9351b50e7833e56913922b9ab5 100644 (file)
@@ -422,7 +422,7 @@ static void update_bmc_sta(struct adapter *padapter)
        int i, supportRateNum = 0;
        unsigned int tx_ra_bitmap = 0;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct wlan_bssid_ex *pcur_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pcur_network = &pmlmepriv->cur_network.network;
        struct sta_info *psta = rtw_get_bcmc_stainfo(padapter);
 
        if (psta) {
@@ -599,7 +599,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
        struct registry_priv     *pregpriv = &padapter->registrypriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
        struct security_priv *psecuritypriv = &padapter->securitypriv;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pnetwork = &pmlmepriv->cur_network.network;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info    *pmlmeinfo = &pmlmeext->mlmext_info;
        struct wlan_bssid_ex *pnetwork_mlmeext = &pmlmeinfo->network;
@@ -711,7 +711,7 @@ static void start_bss_network(struct adapter *padapter, u8 *pbuf)
        update_wireless_mode(padapter);
 
        /* update capability after cur_wireless_mode updated */
-       update_capinfo(padapter, rtw_get_capability((struct wlan_bssid_ex *)pnetwork));
+       update_capinfo(padapter, rtw_get_capability(pnetwork));
 
        /* let pnetwork_mlmeext == pnetwork_mlme. */
        memcpy(pnetwork_mlmeext, pnetwork, pnetwork->Length);
@@ -745,7 +745,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
        struct registry_priv *pregistrypriv = &padapter->registrypriv;
        struct security_priv *psecuritypriv = &padapter->securitypriv;
        struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
-       struct wlan_bssid_ex *pbss_network = (struct wlan_bssid_ex *)&pmlmepriv->cur_network.network;
+       struct wlan_bssid_ex *pbss_network = &pmlmepriv->cur_network.network;
        u8 *ie = pbss_network->ies;
 
        /* SSID */
@@ -982,7 +982,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf,  int len)
                HT_info_handler(padapter, (struct ndis_802_11_var_ie *)pHT_info_ie);
        }
 
-       pbss_network->Length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex  *)pbss_network);
+       pbss_network->Length = get_wlan_bssid_ex_sz(pbss_network);
 
        /* issue beacon to start bss network */
        start_bss_network(padapter, (u8 *)pbss_network);
index a97d500810716538644843b9efa4b9af0190dc16..5c300865eeb352ff9eeffa7264dc6163622b99dc 100644 (file)
@@ -330,7 +330,7 @@ u8 rtw_createbss_cmd(struct adapter  *padapter)
        INIT_LIST_HEAD(&pcmd->list);
        pcmd->cmdcode = _CreateBss_CMD_;
        pcmd->parmbuf = (unsigned char *)pdev_network;
-       pcmd->cmdsz = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
+       pcmd->cmdsz = get_wlan_bssid_ex_sz(pdev_network);
        pcmd->rsp = NULL;
        pcmd->rspsz = 0;
        pdev_network->Length = pcmd->cmdsz;
@@ -387,7 +387,7 @@ u8 rtw_joinbss_cmd(struct adapter  *padapter, struct wlan_network *pnetwork)
                }
        }
 
-       psecnetwork = (struct wlan_bssid_ex *)&psecuritypriv->sec_bss;
+       psecnetwork = &psecuritypriv->sec_bss;
        if (!psecnetwork) {
                kfree(pcmd);
 
index 14be5a70361508f9a95617431ad7169045ec7bf7..9d12f92994b3f1a5ee1f32349748128766d48f62 100644 (file)
@@ -1815,7 +1815,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
 
        sz = rtw_generate_ie(pregistrypriv);
        pdev_network->ie_length = sz;
-       pdev_network->Length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex  *)pdev_network);
+       pdev_network->Length = get_wlan_bssid_ex_sz(pdev_network);
 
        /* notes: translate ie_length & Length after assign the Length to cmdsz in createbss_cmd(); */
        /* pdev_network->ie_length = cpu_to_le32(sz); */
index 5ca8a2b158d7384c15e02d080cbb39c6959e1a4b..b3eddcb83cd06aadb4edb870b2668ace91d2b677 100644 (file)
@@ -1771,7 +1771,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
 
                        plist = plist->next;
 
-                       pbss_network = (struct wlan_bssid_ex *)&pnetwork->network;
+                       pbss_network = &pnetwork->network;
 
                        p = rtw_get_ie(pbss_network->ies + _FIXED_IE_LENGTH_, _HT_CAPABILITY_IE_, &len, pbss_network->ie_length - _FIXED_IE_LENGTH_);
                        if (!p || len == 0) { /* non-HT */
@@ -2131,7 +2131,7 @@ static u8 collect_bss_info(struct adapter *padapter,
        bssid->Configuration.BeaconPeriod =
                get_unaligned_le16(rtw_get_beacon_interval_from_ie(bssid->ies));
 
-       val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
+       val16 = rtw_get_capability(bssid);
 
        if (val16 & BIT(0)) {
                bssid->InfrastructureMode = Ndis802_11Infrastructure;
@@ -2177,7 +2177,7 @@ static void start_create_ibss(struct adapter *padapter)
        u8 join_type;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&pmlmeinfo->network);
+       struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
 
        pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig;
        pmlmeinfo->bcn_interval = get_beacon_interval(pnetwork);
@@ -2186,7 +2186,7 @@ static void start_create_ibss(struct adapter *padapter)
        update_wireless_mode(padapter);
 
        /* update capability */
-       caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
+       caps = rtw_get_capability(pnetwork);
        update_capinfo(padapter, caps);
        if (caps & cap_IBSS) {/* adhoc master */
                val8 = 0xcf;
@@ -2228,7 +2228,7 @@ static void start_clnt_join(struct adapter *padapter)
        u8 val8;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&pmlmeinfo->network);
+       struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
        int beacon_timeout;
 
        pmlmeext->cur_channel = (u8)pnetwork->Configuration.DSConfig;
@@ -2238,7 +2238,7 @@ static void start_clnt_join(struct adapter *padapter)
        update_wireless_mode(padapter);
 
        /* update capability */
-       caps = rtw_get_capability((struct wlan_bssid_ex *)pnetwork);
+       caps = rtw_get_capability(pnetwork);
        update_capinfo(padapter, caps);
        if (caps & cap_ESS) {
                Set_MSR(padapter, WIFI_FW_STATION_STATE);
@@ -4193,7 +4193,7 @@ void report_survey_event(struct adapter *padapter,
 
        psurvey_evt = (struct survey_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
 
-       if (collect_bss_info(padapter, precv_frame, (struct wlan_bssid_ex *)&psurvey_evt->bss) == _FAIL) {
+       if (collect_bss_info(padapter, precv_frame, &psurvey_evt->bss) == _FAIL) {
                kfree(pcmd_obj);
                kfree(pevtcmd);
                return;
@@ -4851,7 +4851,7 @@ u8 createbss_hdl(struct adapter *padapter, u8 *pbuf)
 {
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&pmlmeinfo->network);
+       struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
        struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
 
        if (pparm->InfrastructureMode == Ndis802_11APMode) {
@@ -4913,7 +4913,7 @@ u8 join_cmd_hdl(struct adapter *padapter, u8 *pbuf)
        struct registry_priv *pregpriv = &padapter->registrypriv;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&pmlmeinfo->network);
+       struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
        struct wlan_bssid_ex *pparm = (struct wlan_bssid_ex *)pbuf;
        u32 i;
 
@@ -5024,7 +5024,7 @@ u8 disconnect_hdl(struct adapter *padapter, unsigned char *pbuf)
        struct disconnect_parm *param = (struct disconnect_parm *)pbuf;
        struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
-       struct wlan_bssid_ex *pnetwork = (struct wlan_bssid_ex *)(&pmlmeinfo->network);
+       struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
        u8 val8;
 
        if (is_client_associated_to_ap(padapter))
index 8e8f1721b1a2b1f193395a3a64ae6dc67c267c9a..26f128836a5e5fdd6b77c441316f382d0b8f6d1e 100644 (file)
@@ -906,7 +906,7 @@ int rtw_check_bcn_info(struct adapter  *Adapter, u8 *pframe, u32 packet_len)
        }
 
        /* check encryption info */
-       val16 = rtw_get_capability((struct wlan_bssid_ex *)bssid);
+       val16 = rtw_get_capability(bssid);
 
        if (val16 & BIT(4))
                bssid->Privacy = 1;
@@ -1017,7 +1017,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
        struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
        struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
 
-       if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
+       if (rtw_get_capability(cur_network) & WLAN_CAPABILITY_PRIVACY) {
                for (i = sizeof(struct ndis_802_11_fixed_ie); i < pmlmeinfo->network.ie_length;) {
                        pIE = (struct ndis_802_11_var_ie *)(pmlmeinfo->network.ies + i);