OSDN Git Service

staging:rtl8188eu Fix coding style issues
authorJanani Sankara Babu <jananis37@gmail.com>
Tue, 5 Sep 2017 10:36:36 +0000 (16:06 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 Sep 2017 14:35:25 +0000 (16:35 +0200)
This patch aims to solve coding style issues by placing constants on the
right side of the test

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c

index 4ab1f75..9ba511a 100644 (file)
@@ -525,7 +525,7 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
                pwrctrlpriv->power_mgnt = PS_MODE_ACTIVE;
        else
                pwrctrlpriv->power_mgnt = padapter->registrypriv.power_mgnt;/*  PS_MODE_MIN; */
-       pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false;
+       pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false;
 
        pwrctrlpriv->bFwCurrentInPSMode = false;
 
@@ -595,7 +595,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
        }
        if (rf_off == pwrpriv->rf_pwrstate) {
                DBG_88E("%s call ips_leave....\n", __func__);
-               if (_FAIL ==  ips_leave(padapter)) {
+               if (ips_leave(padapter) ==  _FAIL) {
                        DBG_88E("======> ips_leave fail.............\n");
                        ret = _FAIL;
                        goto exit;
@@ -628,12 +628,12 @@ int rtw_pm_set_lps(struct adapter *padapter, u8 mode)
 
        if (mode < PS_MODE_NUM) {
                if (pwrctrlpriv->power_mgnt != mode) {
-                       if (PS_MODE_ACTIVE == mode)
+                       if (mode == PS_MODE_ACTIVE)
                                LeaveAllPowerSaveMode(padapter);
                        else
                                pwrctrlpriv->LpsIdleCount = 2;
                        pwrctrlpriv->power_mgnt = mode;
-                       pwrctrlpriv->bLeisurePs = (PS_MODE_ACTIVE != pwrctrlpriv->power_mgnt) ? true : false;
+                       pwrctrlpriv->bLeisurePs = (pwrctrlpriv->power_mgnt != PS_MODE_ACTIVE) ? true : false;
                }
        } else {
                ret = -EINVAL;
@@ -653,7 +653,7 @@ int rtw_pm_set_ips(struct adapter *padapter, u8 mode)
        } else if (mode == IPS_NONE) {
                rtw_ips_mode_req(pwrctrlpriv, mode);
                DBG_88E("%s %s\n", __func__, "IPS_NONE");
-               if ((padapter->bSurpriseRemoved == 0) && (_FAIL == rtw_pwr_wakeup(padapter)))
+               if ((padapter->bSurpriseRemoved == 0) && (rtw_pwr_wakeup(padapter) == _FAIL))
                        return -EFAULT;
        } else {
                return -EINVAL;