Skip to contentSkip to conversation

staging: vt6656: remove variable declaration

PATCH In review Kaaira Gupta 2 participants 3 messages Mar 9, 2020 – Mar 10, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/7 staging: vt6656: remove variable declaration

int ret is uneccesarily declared and initialised to 0. Return 0 directly.

---
 drivers/staging/vt6656/card.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vt6656/card.c +1 -3
index 7958fc165462..5592b558cbd4 100644
@@ -719,8 +719,6 @@ int vnt_radio_power_off(struct vnt_private *priv)
  */
 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);
@@ -739,7 +737,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.17.1
#1 lore raw

--- Please note the new email address ---

Quoted 22 lines · Kaaira Gupta

int ret is uneccesarily declared and initialised to 0. Return 0 directly.

---
 drivers/staging/vt6656/card.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vt6656/card.c +0 -2
index 7958fc165462..5592b558cbd4 100644
@@ -719,8 +719,6 @@ int vnt_radio_power_off(struct vnt_private *priv)
  */
 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);

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

Quoted 6 lines
drivers/staging/vt6656/card.c +1 -1
@@ -739,7 +737,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;
 }

The change looks fine, but since the change has to do with the return value, itcould be reasonable to adjust the comment about the return value as well:

Return Value: true if success; otherwise false

Actually, the comment seems completely off, since the function does not return either true or false.

julia

#2 lore raw
Quoted 3 lines · Julia Lawall

--- Please note the new email address ---

Which mail address?

Quoted 29 lines · Kaaira Gupta
Quoted 26 lines

int ret is uneccesarily declared and initialised to 0. Return 0 directly.

---
 drivers/staging/vt6656/card.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/vt6656/card.c +0 -2
index 7958fc165462..5592b558cbd4 100644
@@ -719,8 +719,6 @@ int vnt_radio_power_off(struct vnt_private *priv)
  */
 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);
@@ -739,7 +737,7 @@ int vnt_radio_power_on(struct vnt_private *priv)
 
 	vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD);
 
Quoted 7 lines

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

Quoted 3 lines
drivers/staging/vt6656/card.c +1 -1
-	return ret;
+	return 0;
 }

The change looks fine, but since the change has to do with the return value, itcould be reasonable to adjust the comment about the return value as well:

Please explain where I should add this comment? Are you talking about the commit?

Quoted 7 lines

Return Value: true if success; otherwise false

Actually, the comment seems completely off, since the function does not return either true or false.

julia