staging: rtl8712: Change return values in r8712_init_cmd_priv()
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Mon, 24 Jun 2019 05:48:54 +0000 (11:18 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Jun 2019 02:00:08 +0000 (10:00 +0800)
Change return values in r8712_init_cmd_priv from _SUCCESS/_FAIL to
0/-ENOMEM. Modify call site accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/os_intfs.c
drivers/staging/rtl8712/rtl871x_cmd.c

index 1653b36..ef9e963 100644 (file)
@@ -297,7 +297,7 @@ static u8 init_default_value(struct _adapter *padapter)
 
 u8 r8712_init_drv_sw(struct _adapter *padapter)
 {
-       if ((r8712_init_cmd_priv(&padapter->cmdpriv)) == _FAIL)
+       if (r8712_init_cmd_priv(&padapter->cmdpriv))
                return _FAIL;
        padapter->cmdpriv.padapter = padapter;
        if ((r8712_init_evt_priv(&padapter->evtpriv)) == _FAIL)
index c6643c3..68efba1 100644 (file)
@@ -55,7 +55,7 @@ int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv)
        pcmdpriv->cmd_allocated_buf = kmalloc(MAX_CMDSZ + CMDBUFF_ALIGN_SZ,
                                              GFP_ATOMIC);
        if (!pcmdpriv->cmd_allocated_buf)
-               return _FAIL;
+               return -ENOMEM;
        pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf  +  CMDBUFF_ALIGN_SZ -
                            ((addr_t)(pcmdpriv->cmd_allocated_buf) &
                            (CMDBUFF_ALIGN_SZ - 1));
@@ -63,14 +63,14 @@ int r8712_init_cmd_priv(struct cmd_priv *pcmdpriv)
        if (!pcmdpriv->rsp_allocated_buf) {
                kfree(pcmdpriv->cmd_allocated_buf);
                pcmdpriv->cmd_allocated_buf = NULL;
-               return _FAIL;
+               return -ENOMEM;
        }
        pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf  +  4 -
                            ((addr_t)(pcmdpriv->rsp_allocated_buf) & 3);
        pcmdpriv->cmd_issued_cnt = 0;
        pcmdpriv->cmd_done_cnt = 0;
        pcmdpriv->rsp_cnt = 0;
-       return _SUCCESS;
+       return 0;
 }
 
 static sint _init_evt_priv(struct evt_priv *pevtpriv)