Skip to contentSkip to conversation

staging: vt6656: remove unneeded variable: ret

PATCH In review John B. Wyatt IV 2 participants 3 messages Mar 22, 2020 – Mar 24, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: vt6656: remove unneeded variable: ret

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

Update function documentation (comment) on the return status as suggested by Julia Lawall <[email protected]>.

Issue reported by coccinelle (coccicheck).

---
 drivers/staging/vt6656/card.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/vt6656/card.c +2 -4
index dc3ab10eb630..05b57a2489a0 100644
@@ -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)
Signature · 1 line
2.25.1
#1 lore raw
Quoted 17 lines · 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 <[email protected]>.

Issue reported by coccinelle (coccicheck).

---
 drivers/staging/vt6656/card.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/vt6656/card.c +0 -0
index dc3ab10eb630..05b57a2489a0 100644

drivers/staging/vt6656/card.c int vnt_radio_power_off(struct vnt_private *priv) · line 719

Quoted 5 lines
drivers/staging/vt6656/card.c +1 -1
@@ -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

author
#2 lore raw
Quoted 28 lines · Greg Kroah-Hartman
Quoted 18 lines · 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 <[email protected]>.

Issue reported by coccinelle (coccicheck).

---
 drivers/staging/vt6656/card.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/staging/vt6656/card.c +0 -0
index dc3ab10eb630..05b57a2489a0 100644

drivers/staging/vt6656/card.c int vnt_radio_power_off(struct vnt_private · line 720

Quoted 6 lines
drivers/staging/vt6656/card.c +1 -1
@@ -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?

Quoted 3 lines

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

Understood. Patchset sent.

Adding the URL to the patchset to make it easy to track.

https://groups.google.com/forum/#!topic/outreachy-kernel/19S4zdbNLIg