staging: rtl8712: r8712_register_cmd_alive(): Change return values
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Mon, 22 Jul 2019 09:23:37 +0000 (14:53 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2019 07:52:00 +0000 (09:52 +0200)
Change return values of r8712_register_cmd_alive from _SUCCESS and _FAIL
to 0 and -EINVAL.
Change the return type of this function from sint to int.
Modify its call site to check for 0 instead of _SUCCESS.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Link: https://lore.kernel.org/r/20190722092341.21030-4-nishkadg.linux@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl8712_cmd.c
drivers/staging/rtl8712/rtl871x_pwrctrl.c
drivers/staging/rtl8712/rtl871x_pwrctrl.h

index 6a72a4ad176afb6fa1e28fb47d3f306bdb9787a4..f99fd7cfa4450062cf39e6b879d38dc03d99d8d4 100644 (file)
@@ -311,7 +311,7 @@ int r8712_cmd_thread(void *context)
                        break;
                if (padapter->driver_stopped || padapter->surprise_removed)
                        break;
-               if (r8712_register_cmd_alive(padapter) != _SUCCESS)
+               if (r8712_register_cmd_alive(padapter))
                        continue;
 _next:
                pcmd = r8712_dequeue_cmd(&pcmdpriv->cmd_queue);
index 2beafc7742b392868da4a53c4d0cfd1f7fc9553e..23cff43437e21e37fd399b70b8cd9cc736fcb216 100644 (file)
@@ -184,19 +184,19 @@ void r8712_init_pwrctrl_priv(struct _adapter *padapter)
  * will raise the cpwm to be greater than or equal to P2.
  * Calling Context: Passive
  * Return Value:
- * _SUCCESS: r8712_cmd_thread can issue cmds to firmware afterwards.
- * _FAIL: r8712_cmd_thread can not do anything.
+ * 0:      r8712_cmd_thread can issue cmds to firmware afterwards.
+ * -EINVAL: r8712_cmd_thread can not do anything.
  */
-sint r8712_register_cmd_alive(struct _adapter *padapter)
+int r8712_register_cmd_alive(struct _adapter *padapter)
 {
-       uint res = _SUCCESS;
+       int res = 0;
        struct pwrctrl_priv *pwrctrl = &padapter->pwrctrlpriv;
 
        mutex_lock(&pwrctrl->mutex_lock);
        register_task_alive(pwrctrl, CMD_ALIVE);
        if (pwrctrl->cpwm < PS_STATE_S2) {
                r8712_set_rpwm(padapter, PS_STATE_S3);
-               res = _FAIL;
+               res = -EINVAL;
        }
        mutex_unlock(&pwrctrl->mutex_lock);
        return res;
index 11b5034f203db8cee595591b1691a5bb4a48c22b..dd5a79f90b1a6010849057661cadaaece4808fc5 100644 (file)
@@ -104,7 +104,7 @@ struct      pwrctrl_priv {
 };
 
 void r8712_init_pwrctrl_priv(struct _adapter *adapter);
-sint r8712_register_cmd_alive(struct _adapter *padapter);
+int r8712_register_cmd_alive(struct _adapter *padapter);
 void r8712_unregister_cmd_alive(struct _adapter *padapter);
 void r8712_cpwm_int_hdl(struct _adapter *padapter,
                        struct reportpwrstate_parm *preportpwrstate);