lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 28 Dec 2023 11:43:28 +0000
From: Kieran Bingham <kieran.bingham@...asonboard.com>
To: Bhavin Sharma <bhavin.sharma@...iconsignals.io>, lars@...afoo.de, linux-kernel@...r.kernel.org, linux-media@...r.kernel.org, mchehab@...nel.org
Cc: bhavin.sharma@...iconsignals.io
Subject: Re: [PATCH] media: adv7180: Fix cppcheck warnings and errors

Quoting Bhavin Sharma (2023-12-27 13:35:16)
> WARNING: Missing a blank line after declarations
> ERROR: else should follow close brace '}'
> 
> Signed-off-by: Bhavin Sharma <bhavin.sharma@...iconsignals.io>
> 
> diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
> index 54134473186b..91756116eff7 100644
> --- a/drivers/media/i2c/adv7180.c
> +++ b/drivers/media/i2c/adv7180.c
> @@ -357,6 +357,7 @@ static int adv7180_querystd(struct v4l2_subdev *sd, v4l2_std_id *std)
>  {
>         struct adv7180_state *state = to_state(sd);

Personally, I would keep the if (err) hugging the line it's associated
with.


>         int err = mutex_lock_interruptible(&state->mutex);
> +
>         if (err)
>                 return err;
>  
> @@ -411,6 +412,7 @@ static int adv7180_g_input_status(struct v4l2_subdev *sd, u32 *status)
>  {
>         struct adv7180_state *state = to_state(sd);
>         int ret = mutex_lock_interruptible(&state->mutex);
> +
>         if (ret)
>                 return ret;
>  
> @@ -1046,8 +1048,7 @@ static int adv7182_init(struct adv7180_state *state)
>                                               ADV7180_REG_EXTENDED_OUTPUT_CONTROL,
>                                               0x17);
>                         }
> -               }
> -               else
> +               } else

I think kernel code style requires an else clause following a multiline
scope to also have its scope enclosed in braces even if it's a single
statement.

--
Kieran

>                         adv7180_write(state,
>                                       ADV7180_REG_EXTENDED_OUTPUT_CONTROL,
>                                       0x07);
> -- 
> 2.25.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ