2022-01-12 09:17:31

by CGEL

[permalink] [raw]
Subject: [PATCH] media: i2c: remove unneeded variable

From: Changcheng Deng <[email protected]>

Remove unneeded variable used to store return value.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Changcheng Deng <[email protected]>
---
drivers/media/i2c/ov5693.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
index 2784fcf67f3b..a55910f6283a 100644
--- a/drivers/media/i2c/ov5693.c
+++ b/drivers/media/i2c/ov5693.c
@@ -950,7 +950,6 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
unsigned int width, height;
unsigned int hblank;
int exposure_max;
- int ret = 0;

crop = __ov5693_get_pad_crop(ov5693, state, format->pad, format->which);

@@ -982,7 +981,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
format->format = *fmt;

if (format->which == V4L2_SUBDEV_FORMAT_TRY)
- return ret;
+ return 0;

mutex_lock(&ov5693->lock);

@@ -1012,7 +1011,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
exposure_max));

mutex_unlock(&ov5693->lock);
- return ret;
+ return 0;
}

static int ov5693_get_selection(struct v4l2_subdev *sd,
--
2.25.1



2022-01-12 09:19:18

by Hans Verkuil

[permalink] [raw]
Subject: Re: [PATCH] media: i2c: remove unneeded variable

On 12/01/2022 10:17, [email protected] wrote:
> From: Changcheng Deng <[email protected]>
>
> Remove unneeded variable used to store return value.

Please add the driver name in the subject prefix! Why is that so hard to
remember?

Regards,

Hans

>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Changcheng Deng <[email protected]>
> ---
> drivers/media/i2c/ov5693.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
> index 2784fcf67f3b..a55910f6283a 100644
> --- a/drivers/media/i2c/ov5693.c
> +++ b/drivers/media/i2c/ov5693.c
> @@ -950,7 +950,6 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> unsigned int width, height;
> unsigned int hblank;
> int exposure_max;
> - int ret = 0;
>
> crop = __ov5693_get_pad_crop(ov5693, state, format->pad, format->which);
>
> @@ -982,7 +981,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> format->format = *fmt;
>
> if (format->which == V4L2_SUBDEV_FORMAT_TRY)
> - return ret;
> + return 0;
>
> mutex_lock(&ov5693->lock);
>
> @@ -1012,7 +1011,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> exposure_max));
>
> mutex_unlock(&ov5693->lock);
> - return ret;
> + return 0;
> }
>
> static int ov5693_get_selection(struct v4l2_subdev *sd,


2022-01-14 00:03:20

by Daniel Scally

[permalink] [raw]
Subject: Re: [PATCH] media: i2c: remove unneeded variable

Hello

On 12/01/2022 09:17, [email protected] wrote:
> From: Changcheng Deng <[email protected]>
>
> Remove unneeded variable used to store return value.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Changcheng Deng <[email protected]>

Yeah good catch. With Hans' comment about the subject line addressed:

Reviewed-by: Daniel Scally <[email protected]>

> ---
> drivers/media/i2c/ov5693.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/ov5693.c b/drivers/media/i2c/ov5693.c
> index 2784fcf67f3b..a55910f6283a 100644
> --- a/drivers/media/i2c/ov5693.c
> +++ b/drivers/media/i2c/ov5693.c
> @@ -950,7 +950,6 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> unsigned int width, height;
> unsigned int hblank;
> int exposure_max;
> - int ret = 0;
>
> crop = __ov5693_get_pad_crop(ov5693, state, format->pad, format->which);
>
> @@ -982,7 +981,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> format->format = *fmt;
>
> if (format->which == V4L2_SUBDEV_FORMAT_TRY)
> - return ret;
> + return 0;
>
> mutex_lock(&ov5693->lock);
>
> @@ -1012,7 +1011,7 @@ static int ov5693_set_fmt(struct v4l2_subdev *sd,
> exposure_max));
>
> mutex_unlock(&ov5693->lock);
> - return ret;
> + return 0;
> }
>
> static int ov5693_get_selection(struct v4l2_subdev *sd,
>