[PATCH 03/10] staging: rtl8712: Change return values of r8712_init_evt_priv()

Nishka Dasgupta nishkadg.linux at gmail.com
Mon Jun 24 05:48:56 UTC 2019


Change return values of the function r8712_init_evt_priv from
_SUCCESS/_FAIL to 0/-ENOMEM. Modify call site accordingly.

Signed-off-by: Nishka Dasgupta <nishkadg.linux at gmail.com>
---
 drivers/staging/rtl8712/os_intfs.c    | 2 +-
 drivers/staging/rtl8712/rtl871x_cmd.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c
index ef9e9634b298..85a43fd67ca5 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -300,7 +300,7 @@ u8 r8712_init_drv_sw(struct _adapter *padapter)
 	if (r8712_init_cmd_priv(&padapter->cmdpriv))
 		return _FAIL;
 	padapter->cmdpriv.padapter = padapter;
-	if ((r8712_init_evt_priv(&padapter->evtpriv)) == _FAIL)
+	if (r8712_init_evt_priv(&padapter->evtpriv))
 		return _FAIL;
 	if (r8712_init_mlme_priv(padapter) == _FAIL)
 		return _FAIL;
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c
index baceb5dbf328..bf44f37e773d 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -80,11 +80,11 @@ int r8712_init_evt_priv(struct evt_priv *pevtpriv)
 	pevtpriv->evt_allocated_buf = kmalloc(MAX_EVTSZ + 4, GFP_ATOMIC);
 
 	if (!pevtpriv->evt_allocated_buf)
-		return _FAIL;
+		return -ENOMEM;
 	pevtpriv->evt_buf = pevtpriv->evt_allocated_buf  +  4 -
 			    ((addr_t)(pevtpriv->evt_allocated_buf) & 3);
 	pevtpriv->evt_done_cnt = 0;
-	return _SUCCESS;
+	return 0;
 }
 
 static void _free_evt_priv(struct evt_priv *pevtpriv)
-- 
2.19.1



More information about the devel mailing list