Commit c3397c1b authored by Thaissa Falbo's avatar Thaissa Falbo Committed by Greg Kroah-Hartman

staging: media: davinci_vpfe: remove ret variable in switch statements

Remove ret variable in functions that used it to determine the return.
Simplified the return logic for these functions.

Found with Coccinelle script:

@@
local idexpression ret;
expression c,d;
identifier label;
@@

switch ( ... ) {
case label :
...
- ret = c;
- break;
+ return c;
...
default:
...
- ret = d;
+ return d;
...
}
... when != ret
- return ret;

@@
type T; identifier i;
@@
- T i;
... when != i
Signed-off-by: default avatarThaissa Falbo <thaissa.falbo@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent afa5d19a
...@@ -1350,21 +1350,16 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg) ...@@ -1350,21 +1350,16 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg)
*/ */
static long ipipe_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) static long ipipe_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{ {
int ret = 0;
switch (cmd) { switch (cmd) {
case VIDIOC_VPFE_IPIPE_S_CONFIG: case VIDIOC_VPFE_IPIPE_S_CONFIG:
ret = ipipe_s_config(sd, arg); return ipipe_s_config(sd, arg);
break;
case VIDIOC_VPFE_IPIPE_G_CONFIG: case VIDIOC_VPFE_IPIPE_G_CONFIG:
ret = ipipe_g_config(sd, arg); return ipipe_g_config(sd, arg);
break;
default: default:
ret = -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
return ret;
} }
void vpfe_ipipe_enable(struct vpfe_device *vpfe_dev, int en) void vpfe_ipipe_enable(struct vpfe_device *vpfe_dev, int en)
......
...@@ -626,21 +626,16 @@ static int isif_set_params(struct v4l2_subdev *sd, void *params) ...@@ -626,21 +626,16 @@ static int isif_set_params(struct v4l2_subdev *sd, void *params)
*/ */
static long isif_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) static long isif_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
{ {
int ret;
switch (cmd) { switch (cmd) {
case VIDIOC_VPFE_ISIF_S_RAW_PARAMS: case VIDIOC_VPFE_ISIF_S_RAW_PARAMS:
ret = isif_set_params(sd, arg); return isif_set_params(sd, arg);
break;
case VIDIOC_VPFE_ISIF_G_RAW_PARAMS: case VIDIOC_VPFE_ISIF_G_RAW_PARAMS:
ret = isif_get_params(sd, arg); return isif_get_params(sd, arg);
break;
default: default:
ret = -ENOIOCTLCMD; return -ENOIOCTLCMD;
} }
return ret;
} }
static void isif_config_gain_offset(struct vpfe_isif_device *isif) static void isif_config_gain_offset(struct vpfe_isif_device *isif)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment