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>
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)
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)
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)