* [PATCH 3/8] staging: unisys: visorbus: Remove useless return variables
@ 2016-02-24 20:26 Bhaktipriya Shridhar
0 siblings, 0 replies; only message in thread
From: Bhaktipriya Shridhar @ 2016-02-24 20:26 UTC (permalink / raw)
To: outreachy-kernel
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>
---
drivers/staging/unisys/visorbus/visorbus_main.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index a301385..1542206 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-02-24 20:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24 20:26 [PATCH 3/8] staging: unisys: visorbus: Remove useless return variables Bhaktipriya Shridhar
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.