Skip to contentSkip to conversation

staging: unisys: visorbus: Remove useless return variables

PATCH Superseded Bhaktipriya Shridhar 1 participant 1 message Feb 25, 2016 Staging

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/8 staging: unisys: visorbus: Remove useless return variables

This patch removes unnecessary return variables and compresses the return logic.
The coccinelle script that finds and fixes this issue is:
@@ type T; identifier i,f; constant C; @@
- T i;
...when != i
when strict
( return -C;
|
- i =
+ return
f(...);
- return i;
)

---
Changes in v2:
-No change

 drivers/staging/unisys/visorbus/visorbus_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/unisys/visorbus/visorbus_main.c +1 -3
index a301385..1542206 100644
@@ -701,12 +701,10 @@ DRIVER_ATTR_version(struct device_driver *xdrv, char *buf)
 static int
 register_driver_attributes(struct visor_driver *drv)
 {
-	int rc;
 	struct driver_attribute version =
 	    __ATTR(version, S_IRUGO, DRIVER_ATTR_version, NULL);
 	drv->version_attr = version;
-	rc = driver_create_file(&drv->driver, &drv->version_attr);
-	return rc;
+	return driver_create_file(&drv->driver, &drv->version_attr);
 }
 
 static void

--
2.1.4