Staging: vt6656: Merge two lines of code into one

Author: Rajbinder Brar <brar.rajbinder@gmail.com>

This patch merges an assignment with an immediately following return of
the assigned variable. The following Coccinelle semantic patch was used
to make this transformation:

@@
expression ret;
identifier f;
@@

-ret=
+return
	f(...);
-return ret;

A variable that became unused due to this transformation was also
removed.

Signed-off-by: Rajbinder Brar 
Acked-by: Julia Lawall 
Signed-off-by: Greg Kroah-Hartman 
---
 drivers/staging/vt6656/rf.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
 
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index c0edcae..c42cde5 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -623,7 +623,6 @@ int vnt_rf_write_embedded(struct vnt_private *priv, u32 data)
 /* Set Tx power by rate and channel number */
 int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
 {
-	int ret = true;
 	u8 power = priv->cck_pwr;
 
 	if (channel == 0)
@@ -653,9 +652,7 @@ int vnt_rf_setpower(struct vnt_private *priv, u32 rate, u32 channel)
 		break;
 	}
 
-	ret = vnt_rf_set_txpower(priv, power, rate);
-
-	return ret;
+	return vnt_rf_set_txpower(priv, power, rate);
 }
 
 static u8 vnt_rf_addpower(struct vnt_private *priv)
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.