Skip to contentSkip to conversation

staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM

PATCH In review Nishka Dasgupta 2 participants 2 messages May 30, 2019 – Jun 3, 2019 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM

Change return values _SUCCESS and _FAIL to 0 and -ENOMEM respectively, to match the convention in the drivers (and also because the return value of this changed function is never checked anyway). Change return type of the function to int (from u8) to allow the return of -ENOMEM.

---
 drivers/staging/rtl8712/rtl871x_cmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rtl8712/rtl871x_cmd.c +4 -4
index 8220829b5c82..e408b15102ce 100644
@@ -773,7 +773,7 @@ u8 r8712_addbareq_cmd(struct _adapter *padapter, u8 tid)
 	return _SUCCESS;
 }
 
-u8 r8712_wdg_timeout_handler(struct _adapter *padapter)
+int r8712_wdg_timeout_handler(struct _adapter *padapter)
 {
 	struct cmd_obj *ph2c;
 	struct drvint_cmd_parm  *pdrvintcmd_param;
@@ -781,18 +781,18 @@ u8 r8712_wdg_timeout_handler(struct _adapter *padapter)
 
 	ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC);
 	if (!ph2c)
-		return _FAIL;
+		return -ENOMEM;
 	pdrvintcmd_param = kmalloc(sizeof(*pdrvintcmd_param), GFP_ATOMIC);
 	if (!pdrvintcmd_param) {
 		kfree(ph2c);
-		return _FAIL;
+		return -ENOMEM;
 	}
 	pdrvintcmd_param->i_cid = WDG_WK_CID;
 	pdrvintcmd_param->sz = 0;
 	pdrvintcmd_param->pbuf = NULL;
 	init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvintcmd_param, _DRV_INT_CMD_);
 	r8712_enqueue_cmd_ex(pcmdpriv, ph2c);
-	return _SUCCESS;
+	return 0;
 }
 
 void r8712_survey_cmd_callback(struct _adapter *padapter, struct cmd_obj *pcmd)
Signature · 1 line
2.19.1
maintainer
#1 lore raw
Quoted 10 lines · Nishka Dasgupta

Change return values _SUCCESS and _FAIL to 0 and -ENOMEM respectively, to match the convention in the drivers (and also because the return value of this changed function is never checked anyway). Change return type of the function to int (from u8) to allow the return of -ENOMEM.

---
 drivers/staging/rtl8712/rtl871x_cmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Also does not apply to my tree :(