staging: media: atomisp: Compress return logic into one line.
authorVarsha Rao <rvarsha016@gmail.com>
Sun, 12 Mar 2017 16:17:04 +0000 (21:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Mar 2017 00:00:37 +0000 (08:00 +0800)
Simplify function return by merging assignment and return into a single
line. The following coccinelle script is used to fix this issue.

@@
expression e;
local idexpression ret;
@@

-ret = e;
-return ret;
+return e;

This patch also removes unnecessary declarations.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/i2c/gc2235.c
drivers/staging/media/atomisp/i2c/ov8858.c

index 4d15e205ee38011cecd030311703b99ceb0f7ef4..6a5a08e9a887b36eeefe05a0e7c951ad285e2e67 100644 (file)
@@ -541,10 +541,7 @@ static int __gc2235_init(struct v4l2_subdev *sd)
 static int is_init;
 static int gc2235_init(struct v4l2_subdev *sd)
 {
-       int ret = 0;
-       ret = __gc2235_init(sd);
-
-       return ret;
+       return __gc2235_init(sd);
 }
 
 static int power_ctrl(struct v4l2_subdev *sd, bool flag)
@@ -585,9 +582,7 @@ static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
 
        ret |= dev->platform_data->gpio1_ctrl(sd, !flag);
        usleep_range(60, 90);
-       ret = dev->platform_data->gpio0_ctrl(sd, flag);
-
-       return ret;
+       return dev->platform_data->gpio0_ctrl(sd, flag);
 }
 
 static int power_up(struct v4l2_subdev *sd)
index cc7da2a4a84ea56457c70474b7a565e908126bc3..9574bc49113cb2b7c908bb45546c4bb5573d1a83 100644 (file)
@@ -2206,9 +2206,7 @@ static struct i2c_driver ov8858_driver = {
 
 static __init int ov8858_init_mod(void)
 {
-       int ret;
-       ret = i2c_add_driver(&ov8858_driver);
-       return ret;
+       return i2c_add_driver(&ov8858_driver);
 }
 
 static __exit void ov8858_exit_mod(void)