All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM
@ 2019-05-30 21:06 Nishka Dasgupta
  2019-06-03 12:20 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Nishka Dasgupta @ 2019-05-30 21:06 UTC (permalink / raw)
  To: larry.finger, florian.c.schilhabel, gregkh, straube.linux, devel,
	linux-kernel
  Cc: 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.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
---
 drivers/staging/rtl8712/rtl871x_cmd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c
index 8220829b5c82..e408b15102ce 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -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)
-- 
2.19.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM
  2019-05-30 21:06 [PATCH] staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM Nishka Dasgupta
@ 2019-06-03 12:20 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-06-03 12:20 UTC (permalink / raw)
  To: Nishka Dasgupta
  Cc: larry.finger, florian.c.schilhabel, straube.linux, devel, linux-kernel

On Fri, May 31, 2019 at 02:36:38AM +0530, Nishka Dasgupta wrote:
> 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.
> 
> Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
> ---
>  drivers/staging/rtl8712/rtl871x_cmd.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Also does not apply to my tree :(

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-03 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-30 21:06 [PATCH] staging: rtl8712: Change _SUCCESS/_FAIL to 0/-ENOMEM Nishka Dasgupta
2019-06-03 12:20 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.