staging: unisys: visorbus: Remove useless return variables
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Thu, 25 Feb 2016 11:56:55 +0000 (17:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Feb 2016 06:41:48 +0000 (22:41 -0800)
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;
)

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c

index 9e048e9a40f01aef9bef1a06765836d912c65400..533bb5b3d28483536b1957e9276d9085b6fb83fe 100644 (file)
@@ -700,12 +700,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