staging: media: bcm2048: Merge assignment with return
authorRehas Sachdeva <aquannie@gmail.com>
Tue, 20 Sep 2016 08:00:24 +0000 (13:30 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2016 11:59:45 +0000 (13:59 +0200)
Instead of storing the return value into a variable and then returning it, we
can club the two into a single return statement. This change was made using
the following semantic patch by Coccinelle:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Rehas Sachdeva <aquannie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/bcm2048/radio-bcm2048.c

index 8dade19..ea15cc6 100644 (file)
@@ -483,10 +483,8 @@ static int bcm2048_set_rds_no_lock(struct bcm2048_device *bdev, u8 rds_on)
                memset(&bdev->rds_info, 0, sizeof(bdev->rds_info));
        }
 
-       err = bcm2048_send_command(bdev, BCM2048_I2C_FM_RDS_SYSTEM,
-                                  bdev->cache_fm_rds_system);
-
-       return err;
+       return bcm2048_send_command(bdev, BCM2048_I2C_FM_RDS_SYSTEM,
+                                   bdev->cache_fm_rds_system);
 }
 
 static int bcm2048_get_rds_no_lock(struct bcm2048_device *bdev)
@@ -1834,9 +1832,7 @@ static int bcm2048_deinit(struct bcm2048_device *bdev)
        if (err < 0)
                return err;
 
-       err = bcm2048_set_power_state(bdev, BCM2048_POWER_OFF);
-
-       return err;
+       return bcm2048_set_power_state(bdev, BCM2048_POWER_OFF);
 }
 
 /*
@@ -1995,9 +1991,7 @@ static ssize_t bcm2048_##prop##_read(struct device *dev,          \
                                                                        \
        value = bcm2048_get_##prop(bdev);                               \
                                                                        \
-       value = sprintf(buf, mask "\n", value);                         \
-                                                                       \
-       return value;                                                   \
+       return sprintf(buf, mask "\n", value);                          \
 }
 
 #define DEFINE_SYSFS_PROPERTY(prop, signal, size, mask, check)         \