staging: r8188eu: remove ODM_CmnInfoPtrArrayHook()
authorMichael Straube <straube.linux@gmail.com>
Fri, 15 Oct 2021 16:35:07 +0000 (18:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Oct 2021 14:38:18 +0000 (16:38 +0200)
In ODM_CmnInfoPtrArrayHook() there is only the case
ODM_CMNINFO_STA_STATUS and the function is called only with this value.
Remove ODM_CmnInfoPtrArrayHook() and fix the three places where it is
called.

Acked-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Phillip Potter <phil@philpotter.co.uk>
Signed-off-by: Michael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20211015163507.9091-8-straube.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/r8188eu/hal/odm.c
drivers/staging/r8188eu/hal/rtl8188e_dm.c
drivers/staging/r8188eu/hal/rtl8188e_hal_init.c
drivers/staging/r8188eu/include/odm.h

index a2cbe727f6e037977295eb685dfe36de8b6d7f07..0987ff3e382ae56d77d9d6369df7a29929687f22 100644 (file)
@@ -292,21 +292,6 @@ void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def Cmn
        }
 }
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm, enum odm_common_info_def CmnInfo, u16 Index, void *pValue)
-{
-       /*  Hook call by reference pointer. */
-       switch  (CmnInfo) {
-       /*  Dynamic call by reference pointer. */
-       case    ODM_CMNINFO_STA_STATUS:
-               pDM_Odm->pODM_StaInfo[Index] = (struct sta_info *)pValue;
-               break;
-       /* To remove the compiler warning, must add an empty default statement to handle the other values. */
-       default:
-               /* do nothing */
-               break;
-       }
-}
-
 /*  Update Band/CHannel/.. The values are dynamic but non-per-packet. */
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value)
 {
index 1ca24a507d6d01f06785c378bde97e7e450b1ffa..f1a1015eedfb2dc3db8c0582bd4b127fadf08eac 100644 (file)
@@ -90,7 +90,7 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
        ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, hal_data->TRxAntDivType);
 
        for (i = 0; i < NUM_STA; i++)
-               ODM_CmnInfoPtrArrayHook(dm_odm, ODM_CMNINFO_STA_STATUS, i, NULL);
+               dm_odm->pODM_StaInfo[i] = NULL;
 }
 
 void rtl8188e_InitHalDm(struct adapter *Adapter)
index dd8d6b4a9d48eb2bae1199e9c20a08996548b5fc..8c00f2dd67da6cc7b56d84384f21ff5e849a6200 100644 (file)
@@ -1671,13 +1671,14 @@ void rtl8188e_SetHalODMVar(struct adapter *Adapter, enum hal_odm_variable eVaria
        case HAL_ODM_STA_INFO:
                {
                        struct sta_info *psta = (struct sta_info *)pValue1;
+
                        if (bSet) {
                                DBG_88E("### Set STA_(%d) info\n", psta->mac_id);
-                               ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, psta);
+                               podmpriv->pODM_StaInfo[psta->mac_id] = psta;
                                ODM_RAInfo_Init(podmpriv, psta->mac_id);
                        } else {
                                DBG_88E("### Clean STA_(%d) info\n", psta->mac_id);
-                               ODM_CmnInfoPtrArrayHook(podmpriv, ODM_CMNINFO_STA_STATUS, psta->mac_id, NULL);
+                               podmpriv->pODM_StaInfo[psta->mac_id] = NULL;
                       }
                }
                break;
index 6cbf64df9be78db350f289d1cbb8fabff935e80d..841603b341bd2a7647c18e193c8b8148c5e5c818 100644 (file)
@@ -305,12 +305,6 @@ enum odm_common_info_def {
        ODM_CMNINFO_BT_BUSY,                    /* Check Bt is using or not */
        ODM_CMNINFO_BT_DISABLE_EDCA,
 /* CALL BY VALUE-------------*/
-
-       /*  Dynamic ptr array hook itms. */
-       ODM_CMNINFO_STA_STATUS,
-       ODM_CMNINFO_PHY_STATUS,
-       ODM_CMNINFO_MAC_STATUS,
-       ODM_CMNINFO_MAX,
 };
 
 /*  2011/10/20 MH Define ODM support ability.  ODM_CMNINFO_ABILITY */
@@ -882,10 +876,6 @@ void ODM_CmnInfoInit(struct odm_dm_struct *pDM_Odm,
 void ODM_CmnInfoHook(struct odm_dm_struct *pDM_Odm,
                     enum odm_common_info_def CmnInfo, void *pValue);
 
-void ODM_CmnInfoPtrArrayHook(struct odm_dm_struct *pDM_Odm,
-                            enum odm_common_info_def CmnInfo,
-                            u16 Index, void *pValue);
-
 void ODM_CmnInfoUpdate(struct odm_dm_struct *pDM_Odm, u32 CmnInfo, u64 Value);
 
 #endif