driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: vt6656: remove unneeded variable: ret
@ 2020-03-22  9:23 John B. Wyatt IV
  2020-03-22 11:26 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: John B. Wyatt IV @ 2020-03-22  9:23 UTC (permalink / raw)
  To: outreachy-kernel, Julia Lawall, Forest Bond, Greg Kroah-Hartman,
	Quentin Deslandes, Colin Ian King, Malcolm Priestley,
	Oscar Carter, devel, linux-kernel
  Cc: John B. Wyatt IV

Remove unneeded variable ret; replace with 0 for the return value.

Update function documentation (comment) on the return status as
suggested by Julia Lawall <julia.lawall@inria.fr>.

Issue reported by coccinelle (coccicheck).

Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
---
 drivers/staging/vt6656/card.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
index dc3ab10eb630..05b57a2489a0 100644
--- a/drivers/staging/vt6656/card.c
+++ b/drivers/staging/vt6656/card.c
@@ -716,13 +716,11 @@ int vnt_radio_power_off(struct vnt_private *priv)
  *  Out:
  *      none
  *
- * Return Value: true if success; otherwise false
+ * Return Value: 0
  *
  */
 int vnt_radio_power_on(struct vnt_private *priv)
 {
-	int ret = 0;
-
 	vnt_exit_deep_sleep(priv);
 
 	vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON);
@@ -741,7 +739,7 @@ int vnt_radio_power_on(struct vnt_private *priv)
 
 	vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
 
-	return ret;
+	return 0;
 }
 
 void vnt_set_bss_mode(struct vnt_private *priv)
-- 
2.25.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] staging: vt6656: remove unneeded variable: ret
  2020-03-22  9:23 [PATCH] staging: vt6656: remove unneeded variable: ret John B. Wyatt IV
@ 2020-03-22 11:26 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2020-03-22 11:26 UTC (permalink / raw)
  To: John B. Wyatt IV
  Cc: devel, Oscar Carter, Malcolm Priestley, linux-kernel,
	Julia Lawall, outreachy-kernel, Forest Bond, Colin Ian King

On Sun, Mar 22, 2020 at 02:23:03AM -0700, John B. Wyatt IV wrote:
> Remove unneeded variable ret; replace with 0 for the return value.
> 
> Update function documentation (comment) on the return status as
> suggested by Julia Lawall <julia.lawall@inria.fr>.
> 
> Issue reported by coccinelle (coccicheck).
> 
> Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
> ---
>  drivers/staging/vt6656/card.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c
> index dc3ab10eb630..05b57a2489a0 100644
> --- a/drivers/staging/vt6656/card.c
> +++ b/drivers/staging/vt6656/card.c
> @@ -716,13 +716,11 @@ int vnt_radio_power_off(struct vnt_private *priv)
>   *  Out:
>   *      none
>   *
> - * Return Value: true if success; otherwise false
> + * Return Value: 0

If this always returns something, why have it return anything at all?

Why not make this a patch series, doing this, and then fixing up the
callers and the function to not return anything.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2020-03-22 11:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-22  9:23 [PATCH] staging: vt6656: remove unneeded variable: ret John B. Wyatt IV
2020-03-22 11:26 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).