Forráskód Böngészése

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>
Eva Rachel Retuya 9 éve
szülő
commit
87f35f02a9
1 módosított fájl, 1 hozzáadás és 3 törlés
  1. 1 3
      drivers/staging/most/hdm-dim2/dim2_sysfs.c

+ 1 - 3
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,
 static ssize_t bus_kobj_attr_store(struct kobject *kobj, struct attribute *attr,
 				   const char *buf, size_t count)
 				   const char *buf, size_t count)
 {
 {
-	ssize_t ret;
 	struct medialb_bus *bus =
 	struct medialb_bus *bus =
 		container_of(kobj, struct medialb_bus, kobj_group);
 		container_of(kobj, struct medialb_bus, kobj_group);
 	struct bus_attr *xattr = container_of(attr, struct bus_attr, attr);
 	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)
 	if (!xattr->store)
 		return -EIO;
 		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 = {
 static struct sysfs_ops const bus_kobj_sysfs_ops = {