summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEva Rachel Retuya <eraretuya@gmail.com>2016-02-21 07:29:38 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-26 06:34:19 (GMT)
commit87f35f02a9193b83657d60695bf981d1a2255fda (patch)
treeaee97506c6bbeac5f9fcf5844a940c9c4fd5db87
parent91dd941996e4a626f9467a33e3573bd7c119e914 (diff)
downloadlinux-87f35f02a9193b83657d60695bf981d1a2255fda.tar.xz
staging: most: compress return logic into one line
Eliminate local variable 'ret' and modify return statement to contain the value being returned directly instead of assigning it first to 'ret' and returning this variable. Coccinelle semantic patch used: @@ expression e, ret; @@ -ret = +return e; -return ret; Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/most/hdm-dim2/dim2_sysfs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/most/hdm-dim2/dim2_sysfs.c b/drivers/staging/most/hdm-dim2/dim2_sysfs.c
index c5b10c7..2b28e4a 100644
--- a/drivers/staging/most/hdm-dim2/dim2_sysfs.c
+++ b/drivers/staging/most/hdm-dim2/dim2_sysfs.c
@@ -63,7 +63,6 @@ static ssize_t bus_kobj_attr_show(struct kobject *kobj, struct attribute *attr,
static ssize_t bus_kobj_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
- ssize_t ret;
struct medialb_bus *bus =
container_of(kobj, struct medialb_bus, kobj_group);
struct bus_attr *xattr = container_of(attr, struct bus_attr, attr);
@@ -71,8 +70,7 @@ static ssize_t bus_kobj_attr_store(struct kobject *kobj, struct attribute *attr,
if (!xattr->store)
return -EIO;
- ret = xattr->store(bus, buf, count);
- return ret;
+ return xattr->store(bus, buf, count);
}
static struct sysfs_ops const bus_kobj_sysfs_ops = {