From: Bhaktipriya Shridhar Date: Thu, 25 Feb 2016 11:56:55 +0000 (+0530) Subject: staging: unisys: visorbus: Remove useless return variables X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2cda64cf6998a1d10961f69e2ac79c69b6d37795;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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; ) Signed-off-by: Bhaktipriya Shridhar Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 9e048e9a40f0..533bb5b3d284 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -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