mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 04:19:23 -04:00
staging: r8188eu: convert rtw_init_cmd_priv() to common error logic
Convert the function rtw_init_cmd_priv() to common kernel error logic. Return 0 on success and negative value on failure. This is part of getting rid of returning _SUCCESS and _FAIL which uses inverted error logic and is used all over the driver. Signed-off-by: Michael Straube <straube.linux@gmail.com> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Link: https://lore.kernel.org/r/20221002074827.8566-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ef2a2422ab
commit
d4fda24757
@@ -54,7 +54,7 @@ static int _rtw_enqueue_cmd(struct __queue *queue, struct cmd_obj *obj)
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
{
|
||||
init_completion(&pcmdpriv->enqueue_cmd);
|
||||
/* sema_init(&(pcmdpriv->cmd_done_sema), 0); */
|
||||
@@ -71,7 +71,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!pcmdpriv->cmd_allocated_buf)
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
|
||||
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1));
|
||||
|
||||
@@ -79,7 +79,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
|
||||
if (!pcmdpriv->rsp_allocated_buf) {
|
||||
kfree(pcmdpriv->cmd_allocated_buf);
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
@@ -87,7 +87,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
|
||||
return _SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
|
||||
@@ -82,7 +82,7 @@ void rtw_free_cmd_obj(struct cmd_obj *pcmd);
|
||||
|
||||
int rtw_cmd_thread(void *context);
|
||||
|
||||
u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
|
||||
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv);
|
||||
void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv);
|
||||
|
||||
int rtw_init_evt_priv(struct evt_priv *pevtpriv);
|
||||
|
||||
@@ -461,7 +461,7 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
|
||||
|
||||
u8 rtw_init_drv_sw(struct adapter *padapter)
|
||||
{
|
||||
if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
|
||||
if (rtw_init_cmd_priv(&padapter->cmdpriv)) {
|
||||
dev_err(dvobj_to_dev(padapter->dvobj), "rtw_init_cmd_priv failed\n");
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user