staging: rtl8192e: Rename pPSC
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 13 Nov 2022 04:35:34 +0000 (05:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Nov 2022 18:50:15 +0000 (19:50 +0100)
Rename variable pPSC to psc to avoid CamelCase which is not accepted by
checkpatch.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/47ded8a906e55d6f09b51cd8f2dfb78b7b92c1cc.1668313325.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
drivers/staging/rtl8192e/rtl8192e/rtl_core.c
drivers/staging/rtl8192e/rtl8192e/rtl_ps.c
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c
drivers/staging/rtl8192e/rtllib.h
drivers/staging/rtl8192e/rtllib_softmac.c

index b144974..c357adf 100644 (file)
@@ -1303,7 +1303,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
                                       enum rt_rf_power_state rf_power_state)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
        bool bResult = true;
        u8      i = 0, QueueID = 0;
@@ -1318,7 +1318,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
                switch (rf_power_state) {
                case rf_on:
                        if ((priv->rtllib->rf_power_state == rf_off) &&
-                            RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
+                            RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
                                bool rtstatus;
                                u32 InitilizeCount = 3;
 
@@ -1335,7 +1335,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
                                        return false;
                                }
 
-                               RT_CLEAR_PS_LEVEL(pPSC,
+                               RT_CLEAR_PS_LEVEL(psc,
                                                  RT_RF_OFF_LEVL_HALT_NIC);
                        } else {
                                rtl92e_writeb(dev, ANAPAR, 0x37);
@@ -1399,11 +1399,11 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
                                        break;
                        }
 
-                       if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
-                           !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
+                       if (psc->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC &&
+                           !RT_IN_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC)) {
                                rtl92e_disable_nic(dev);
-                               RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
-                       } else if (!(pPSC->RegRfPsLevel &
+                               RT_SET_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
+                       } else if (!(psc->RegRfPsLevel &
                                   RT_RF_OFF_LEVL_HALT_NIC)) {
                                rtl92e_set_rf_off(dev);
                        }
index d5eec6d..144bc7c 100644 (file)
@@ -682,7 +682,7 @@ void rtl92e_set_wireless_mode(struct net_device *dev, u8 wireless_mode)
 static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
        bool init_status;
 
@@ -700,7 +700,7 @@ static int _rtl92e_sta_up(struct net_device *dev, bool is_silent_reset)
                return -1;
        }
 
-       RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
+       RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
        priv->bfirst_init = false;
 
        if (priv->polling_timer_on == 0)
@@ -819,10 +819,10 @@ static void _rtl92e_init_priv_handler(struct net_device *dev)
 static void _rtl92e_init_priv_constant(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
 
-       pPSC->reg_max_lps_awake_intvl = 5;
+       psc->reg_max_lps_awake_intvl = 5;
 }
 
 static void _rtl92e_init_priv_variable(struct net_device *dev)
@@ -1271,7 +1271,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
        enum reset_type ResetType = RESET_TYPE_NORESET;
        static u8 check_reset_cnt;
        unsigned long flags;
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
        bool bBusyTraffic = false;
        bool    bHigherBusyTraffic = false;
@@ -1389,7 +1389,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
 
        spin_lock_irqsave(&priv->tx_lock, flags);
        if ((check_reset_cnt++ >= 3) && (!ieee->is_roaming) &&
-           (!priv->rf_change_in_progress) && (!pPSC->bSwRfProcessing)) {
+           (!priv->rf_change_in_progress) && (!psc->bSwRfProcessing)) {
                ResetType = _rtl92e_if_check_reset(dev);
                check_reset_cnt = 3;
        }
@@ -2421,7 +2421,7 @@ bool rtl92e_enable_nic(struct net_device *dev)
 {
        bool init_status = true;
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
 
        if (!priv->up) {
@@ -2437,7 +2437,7 @@ bool rtl92e_enable_nic(struct net_device *dev)
                priv->bdisable_nic = false;
                return false;
        }
-       RT_CLEAR_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
+       RT_CLEAR_PS_LEVEL(psc, RT_RF_OFF_LEVL_HALT_NIC);
        priv->bfirst_init = false;
 
        rtl92e_irq_enable(dev);
index 8a6b7f5..ef4f736 100644 (file)
@@ -100,27 +100,27 @@ void rtl92e_enter_sleep(struct net_device *dev, u64 time)
 static void _rtl92e_ps_update_rf_state(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
 
-       pPSC->bSwRfProcessing = true;
-       rtl92e_set_rf_state(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS);
+       psc->bSwRfProcessing = true;
+       rtl92e_set_rf_state(dev, psc->eInactivePowerState, RF_CHANGE_BY_IPS);
 
-       pPSC->bSwRfProcessing = false;
+       psc->bSwRfProcessing = false;
 }
 
 void rtl92e_ips_enter(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
        enum rt_rf_power_state rt_state;
 
        rt_state = priv->rtllib->rf_power_state;
-       if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
+       if (rt_state == rf_on && !psc->bSwRfProcessing &&
                (priv->rtllib->state != RTLLIB_LINKED) &&
                (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
-               pPSC->eInactivePowerState = rf_off;
+               psc->eInactivePowerState = rf_off;
                _rtl92e_ps_update_rf_state(dev);
        }
 }
@@ -128,14 +128,14 @@ void rtl92e_ips_enter(struct net_device *dev)
 void rtl92e_ips_leave(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
        enum rt_rf_power_state rt_state;
 
        rt_state = priv->rtllib->rf_power_state;
-       if (rt_state != rf_on  && !pPSC->bSwRfProcessing &&
+       if (rt_state != rf_on  && !psc->bSwRfProcessing &&
            priv->rtllib->rf_off_reason <= RF_CHANGE_BY_IPS) {
-               pPSC->eInactivePowerState = rf_on;
+               psc->eInactivePowerState = rf_on;
                _rtl92e_ps_update_rf_state(dev);
        }
 }
@@ -206,7 +206,7 @@ static bool _rtl92e_ps_set_mode(struct net_device *dev, u8 rtPsMode)
 void rtl92e_leisure_ps_enter(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
 
        if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
@@ -215,8 +215,8 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
            (priv->rtllib->iw_mode == IW_MODE_MASTER))
                return;
 
-       if (pPSC->bLeisurePs) {
-               if (pPSC->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
+       if (psc->bLeisurePs) {
+               if (psc->LpsIdleCount >= RT_CHECK_FOR_HANG_PERIOD) {
 
                        if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
                                if (priv->rtllib->SetFwCmdHandler)
@@ -225,17 +225,17 @@ void rtl92e_leisure_ps_enter(struct net_device *dev)
                                                         RTLLIB_PS_UNICAST);
                        }
                } else
-                       pPSC->LpsIdleCount++;
+                       psc->LpsIdleCount++;
        }
 }
 
 void rtl92e_leisure_ps_leave(struct net_device *dev)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        &priv->rtllib->pwr_save_ctrl;
 
-       if (pPSC->bLeisurePs) {
+       if (psc->bLeisurePs) {
                if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
                        _rtl92e_ps_set_mode(dev, RTLLIB_PS_DISABLED);
                        if (priv->rtllib->SetFwCmdHandler)
index d68f8f5..b200d53 100644 (file)
@@ -159,7 +159,7 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
                                           union iwreq_data *wrqu, char *extra)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
        struct rtllib_device *ieee = priv->rtllib;
 
@@ -167,13 +167,13 @@ static int _rtl92e_wx_adapter_power_status(struct net_device *dev,
 
        if (*extra || priv->force_lps) {
                priv->ps_force = false;
-               pPSC->bLeisurePs = true;
+               psc->bLeisurePs = true;
        } else {
                if (priv->rtllib->state == RTLLIB_LINKED)
                        rtl92e_leisure_ps_leave(dev);
 
                priv->ps_force = true;
-               pPSC->bLeisurePs = false;
+               psc->bLeisurePs = false;
                ieee->ps = *extra;
        }
 
@@ -188,7 +188,7 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev,
                                             char *extra)
 {
        struct r8192_priv *priv = rtllib_priv(dev);
-       struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
+       struct rt_pwr_save_ctrl *psc = (struct rt_pwr_save_ctrl *)
                                        (&priv->rtllib->pwr_save_ctrl);
 
        mutex_lock(&priv->wx_mutex);
@@ -196,7 +196,7 @@ static int _rtl92e_wx_set_lps_awake_interval(struct net_device *dev,
        netdev_info(dev, "%s(): set lps awake interval ! extra is %d\n",
                    __func__, *extra);
 
-       pPSC->reg_max_lps_awake_intvl = *extra;
+       psc->reg_max_lps_awake_intvl = *extra;
        mutex_unlock(&priv->wx_mutex);
        return 0;
 }
index 487aa33..6b7b2c8 100644 (file)
@@ -111,11 +111,11 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
 #define SUPPORT_CKIP_MIC                       0x08
 #define SUPPORT_CKIP_PK                        0x10
 #define        RT_RF_OFF_LEVL_HALT_NIC         BIT3
-#define        RT_IN_PS_LEVEL(pPSC, _PS_FLAG)          \
-       ((pPSC->CurPsLevel & _PS_FLAG) ? true : false)
-#define        RT_CLEAR_PS_LEVEL(pPSC, _PS_FLAG)       \
-       (pPSC->CurPsLevel &= (~(_PS_FLAG)))
-#define        RT_SET_PS_LEVEL(pPSC, _PS_FLAG) (pPSC->CurPsLevel |= _PS_FLAG)
+#define        RT_IN_PS_LEVEL(psc, _PS_FLAG)           \
+       ((psc->CurPsLevel & _PS_FLAG) ? true : false)
+#define        RT_CLEAR_PS_LEVEL(psc, _PS_FLAG)        \
+       (psc->CurPsLevel &= (~(_PS_FLAG)))
+#define        RT_SET_PS_LEVEL(psc, _PS_FLAG)  (psc->CurPsLevel |= _PS_FLAG)
 
 /* defined for skb cb field */
 /* At most 28 byte */
index 09cc3b3..ee4173a 100644 (file)
@@ -1504,7 +1504,7 @@ static void rtllib_associate_complete_wq(void *data)
                                     container_of_work_rsl(data,
                                     struct rtllib_device,
                                     associate_complete_wq);
-       struct rt_pwr_save_ctrl *pPSC = &ieee->pwr_save_ctrl;
+       struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
 
        netdev_info(ieee->dev, "Associated successfully with %pM\n",
                    ieee->current_network.bssid);
@@ -1542,7 +1542,7 @@ static void rtllib_associate_complete_wq(void *data)
                ieee->LinkDetectInfo.NumRecvBcnInPeriod = 1;
                ieee->LinkDetectInfo.NumRecvDataInPeriod = 1;
        }
-       pPSC->LpsIdleCount = 0;
+       psc->LpsIdleCount = 0;
        ieee->link_change(ieee->dev);
 
        if (ieee->is_silent_reset) {
@@ -1960,7 +1960,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
 {
        int timeout;
        u8 dtim;
-       struct rt_pwr_save_ctrl *pPSC = &ieee->pwr_save_ctrl;
+       struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
 
        if (ieee->LPSDelayCnt) {
                ieee->LPSDelayCnt--;
@@ -1990,21 +1990,21 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
 
        if (time) {
                if (ieee->bAwakePktSent) {
-                       pPSC->LPSAwakeIntvl = 1;
+                       psc->LPSAwakeIntvl = 1;
                } else {
                        u8 MaxPeriod = 1;
 
-                       if (pPSC->LPSAwakeIntvl == 0)
-                               pPSC->LPSAwakeIntvl = 1;
-                       if (pPSC->reg_max_lps_awake_intvl == 0)
+                       if (psc->LPSAwakeIntvl == 0)
+                               psc->LPSAwakeIntvl = 1;
+                       if (psc->reg_max_lps_awake_intvl == 0)
                                MaxPeriod = 1;
-                       else if (pPSC->reg_max_lps_awake_intvl == 0xFF)
+                       else if (psc->reg_max_lps_awake_intvl == 0xFF)
                                MaxPeriod = ieee->current_network.dtim_period;
                        else
-                               MaxPeriod = pPSC->reg_max_lps_awake_intvl;
-                       pPSC->LPSAwakeIntvl = (pPSC->LPSAwakeIntvl >=
+                               MaxPeriod = psc->reg_max_lps_awake_intvl;
+                       psc->LPSAwakeIntvl = (psc->LPSAwakeIntvl >=
                                               MaxPeriod) ? MaxPeriod :
-                                              (pPSC->LPSAwakeIntvl + 1);
+                                              (psc->LPSAwakeIntvl + 1);
                }
                {
                        u8 LPSAwakeIntvl_tmp = 0;
@@ -2012,23 +2012,23 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)
                        u8 count = ieee->current_network.tim.tim_count;
 
                        if (count == 0) {
-                               if (pPSC->LPSAwakeIntvl > period)
+                               if (psc->LPSAwakeIntvl > period)
                                        LPSAwakeIntvl_tmp = period +
-                                                (pPSC->LPSAwakeIntvl -
+                                                (psc->LPSAwakeIntvl -
                                                 period) -
-                                                ((pPSC->LPSAwakeIntvl-period) %
+                                                ((psc->LPSAwakeIntvl-period) %
                                                 period);
                                else
-                                       LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
+                                       LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl;
 
                        } else {
-                               if (pPSC->LPSAwakeIntvl >
+                               if (psc->LPSAwakeIntvl >
                                    ieee->current_network.tim.tim_count)
                                        LPSAwakeIntvl_tmp = count +
-                                       (pPSC->LPSAwakeIntvl - count) -
-                                       ((pPSC->LPSAwakeIntvl-count)%period);
+                                       (psc->LPSAwakeIntvl - count) -
+                                       ((psc->LPSAwakeIntvl-count)%period);
                                else
-                                       LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;
+                                       LPSAwakeIntvl_tmp = psc->LPSAwakeIntvl;
                        }
 
                *time = ieee->current_network.last_dtim_sta_time