Re: [PATCH 2/3] media: atomisp-gc2235: drop an unused var

Nathan Chancellor
2021-11-12T20:46:30Z

On Thu, Nov 11, 2021 at 11:08:52PM +0000, Mauro Carvalho Chehab wrote:
> Fix this clang Werror with W=1:
>
> drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:573:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
> int ret = -1;
> ^
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>
> To mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1636672052.git.mchehab+huawei@kernel.org/
>
> drivers/staging/media/atomisp/i2c/atomisp-gc2235.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> index 5e7085264189..0e6b2e6100d1 100644
> --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> @@ -570,14 +570,16 @@ static int power_ctrl(struct v4l2_subdev *sd, bool flag)
> static int gpio_ctrl(struct v4l2_subdev *sd, bool flag)
> {
> struct gc2235_device *dev = to_gc2235_sensor(sd);
> - int ret = -1;
> + int ret;
>
> if (!dev || !dev->platform_data)
> return -ENODEV;
>
> - ret |= dev->platform_data->gpio1_ctrl(sd, !flag);
> + ret = dev->platform_data->gpio1_ctrl(sd, !flag);
> usleep_range(60, 90);
> - return dev->platform_data->gpio0_ctrl(sd, flag);
> + ret |= dev->platform_data->gpio0_ctrl(sd, flag);
> +
> + return ret;
> }
>
> static int power_up(struct v4l2_subdev *sd)
> --
> 2.33.1
>
>