Skip to contentSkip to conversation

staging: ks7010: Remove unnecessary variable used to store return value

PATCH New sayli karnik 1 participant 1 message Sep 21, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: ks7010: Remove unnecessary variable used to store return value

This patch removes an unnecessary variable used to store return values in order to reduce memory usage.
Done using coccinelle:
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
return
- ret
+ C
;

---
 drivers/staging/ks7010/ks7010_sdio.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/staging/ks7010/ks7010_sdio.c +2 -3
index 37a4ba3..b27e9b0 100644
@@ -171,12 +171,11 @@ void ks_wlan_hw_wakeup_request(struct ks_wlan_private *priv)
 
 int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 {
-	int rc = 0;
 	unsigned char rw_data;
 	int retval;
 
 	if (priv->reg.powermgt == POWMGT_ACTIVE_MODE)
-		return rc;
+		return 0;
 
 	if (priv->reg.operation_mode == MODE_INFRASTRUCTURE &&
 	    (priv->connect_status & CONNECT_STATUS_MASK) == CONNECT_STATUS) {
@@ -244,7 +243,7 @@ int _ks_wlan_hw_power_save(struct ks_wlan_private *priv)
 		}
 	}
 
-	return rc;
+	return 0;
 }
 
 int ks_wlan_hw_power_save(struct ks_wlan_private *priv)
Signature · 1 line
2.7.4