Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: r8712_register_cmd_alive(): Change return values

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>

authored by

Nishka Dasgupta and committed by
Greg Kroah-Hartman
7c93fdf0 8a73a8c4

+7 -7
+1 -1
drivers/staging/rtl8712/rtl8712_cmd.c
··· 311 311 break; 312 312 if (padapter->driver_stopped || padapter->surprise_removed) 313 313 break; 314 - if (r8712_register_cmd_alive(padapter) != _SUCCESS) 314 + if (r8712_register_cmd_alive(padapter)) 315 315 continue; 316 316 _next: 317 317 pcmd = r8712_dequeue_cmd(&pcmdpriv->cmd_queue);
+5 -5
drivers/staging/rtl8712/rtl871x_pwrctrl.c
··· 184 184 * will raise the cpwm to be greater than or equal to P2. 185 185 * Calling Context: Passive 186 186 * Return Value: 187 - * _SUCCESS: r8712_cmd_thread can issue cmds to firmware afterwards. 188 - * _FAIL: r8712_cmd_thread can not do anything. 187 + * 0: r8712_cmd_thread can issue cmds to firmware afterwards. 188 + * -EINVAL: r8712_cmd_thread can not do anything. 189 189 */ 190 - sint r8712_register_cmd_alive(struct _adapter *padapter) 190 + int r8712_register_cmd_alive(struct _adapter *padapter) 191 191 { 192 - uint res = _SUCCESS; 192 + int res = 0; 193 193 struct pwrctrl_priv *pwrctrl = &padapter->pwrctrlpriv; 194 194 195 195 mutex_lock(&pwrctrl->mutex_lock); 196 196 register_task_alive(pwrctrl, CMD_ALIVE); 197 197 if (pwrctrl->cpwm < PS_STATE_S2) { 198 198 r8712_set_rpwm(padapter, PS_STATE_S3); 199 - res = _FAIL; 199 + res = -EINVAL; 200 200 } 201 201 mutex_unlock(&pwrctrl->mutex_lock); 202 202 return res;
+1 -1
drivers/staging/rtl8712/rtl871x_pwrctrl.h
··· 104 104 }; 105 105 106 106 void r8712_init_pwrctrl_priv(struct _adapter *adapter); 107 - sint r8712_register_cmd_alive(struct _adapter *padapter); 107 + int r8712_register_cmd_alive(struct _adapter *padapter); 108 108 void r8712_unregister_cmd_alive(struct _adapter *padapter); 109 109 void r8712_cpwm_int_hdl(struct _adapter *padapter, 110 110 struct reportpwrstate_parm *preportpwrstate);