mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	"lars@metafoo.de" <lars@metafoo.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"mchehab@kernel.org" <mchehab@kernel.org>
Subject: Re: [PATCH] media: adv7180: Fix cppcheck warnings and errors
Date: Fri, 29 Dec 2023 13:37:14 +0000	[thread overview]
Message-ID: <MAZPR01MB695797DF964AA599AF2D7D05F29DA@MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <170376380893.2881109.11558061738942135116@ping.linuxembedded.co.uk>

Thanks for the reply, Kieran

>> WARNING: Missing a blank line after declarations
>> ERROR: else should follow close brace '}'
>> 
>> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.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.

If we follow the code base pattern for this diver, we are getting same online space in conditional if statements.
So, we need to make changes there also.

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

On many places in driver there is single statement after else without closing 
So, we have to make changes in those places also.

So, better I should make changes in all places and make version V2 patch.

Please give your suggestions.

--
Bhavin Sharma

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

  reply	other threads:[~2023-12-29 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 13:35 Bhavin Sharma
2023-12-28 11:43 ` Kieran Bingham
2023-12-29 13:37   ` Bhavin Sharma [this message]
2024-01-01 15:22     ` Kieran Bingham
2024-02-01 12:13       ` Bhavin Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MAZPR01MB695797DF964AA599AF2D7D05F29DA@MAZPR01MB6957.INDPRD01.PROD.OUTLOOK.COM \
    --to=bhavin.sharma@siliconsignals.io \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=lars@metafoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®