linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Deepak R Varma <drv@mailo.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND v3 2/6] staging: media: atomisp: balance braces around if...else block
Date: Mon, 26 Apr 2021 19:22:39 +0200	[thread overview]
Message-ID: <20210426172238.GA1409@agape.jhs> (raw)
In-Reply-To: <YIbOfjrPG+NIH4wV@192.168.1.8>

On Mon, Apr 26, 2021 at 08:00:22PM +0530, Deepak R Varma wrote:
> On Mon, Apr 26, 2021 at 11:56:11AM +0200, Fabio Aiuto wrote:
> > On Sun, Apr 25, 2021 at 02:12:20PM +0530, Deepak R Varma wrote:
> > > Balance braces around the if else blocks as per the code style guidelines.
> > > Resolves checkpatch script CHECK / WARNING feedback messages.
> > > 
> > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > ---
> > > 
> > > Changes since v2:
> > >    - None.
> > > Changes since v1:
> > >    - None.
> > > 
> > >  drivers/staging/media/atomisp/i2c/atomisp-gc0310.c  | 4 ++--
> > >  drivers/staging/media/atomisp/i2c/atomisp-gc2235.c  | 4 ++--
> > >  drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c | 4 ++--
> > >  drivers/staging/media/atomisp/i2c/atomisp-ov2680.c  | 7 ++++---
> > >  drivers/staging/media/atomisp/i2c/atomisp-ov2722.c  | 4 ++--
> > >  5 files changed, 12 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > > index 6be3ee1d93a5..d68a2bcc9ae1 100644
> > > --- a/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > > +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc0310.c
> > > @@ -872,9 +872,9 @@ static int gc0310_s_power(struct v4l2_subdev *sd, int on)
> > >  {
> > >  	int ret;
> > >  
> > > -	if (on == 0)
> > > +	if (on == 0) {
> > >  		return power_down(sd);
> > > -	else {
> > > +	} else {
> > >  		ret = power_up(sd);
> > >  		if (!ret)
> > >  			return gc0310_init(sd);
> > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > > index 6ba4a8adff7c..e722c639b60d 100644
> > > --- a/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > > +++ b/drivers/staging/media/atomisp/i2c/atomisp-gc2235.c
> > > @@ -658,9 +658,9 @@ static int gc2235_s_power(struct v4l2_subdev *sd, int on)
> > >  {
> > >  	int ret;
> > >  
> > > -	if (on == 0)
> > > +	if (on == 0) {
> > >  		ret = power_down(sd);
> > > -	else {
> > > +	} else {
> > >  		ret = power_up(sd);
> > >  		if (!ret)
> > >  			ret = __gc2235_init(sd);
> > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> > > index f5de81132177..465fc4468442 100644
> > > --- a/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> > > +++ b/drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c
> > > @@ -568,9 +568,9 @@ static int power_down(struct v4l2_subdev *sd)
> > >  
> > >  static int mt9m114_s_power(struct v4l2_subdev *sd, int power)
> > >  {
> > > -	if (power == 0)
> > > +	if (power == 0) {
> > >  		return power_down(sd);
> > > -	else {
> > > +	} else {
> > >  		if (power_up(sd))
> > >  			return -EINVAL;
> > >  
> > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > > index c90730513438..92c52431bd8f 100644
> > > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2680.c
> > > @@ -461,11 +461,12 @@ static int ov2680_v_flip(struct v4l2_subdev *sd, s32 value)
> > >  	ret = ov2680_read_reg(client, 1, OV2680_FLIP_REG, &val);
> > >  	if (ret)
> > >  		return ret;
> > > -	if (value) {
> > > +
> > > +	if (value)
> > >  		val |= OV2680_FLIP_MIRROR_BIT_ENABLE;
> > > -	} else {
> > > +	else
> > >  		val &= ~OV2680_FLIP_MIRROR_BIT_ENABLE;
> > > -	}
> > > +
> > 
> > Hi Deepak,
> > 
> > what you did above is not what is written in the commit message
> > description about. Here unneeded bracks are removed in both
> > branches, is not a matter of braces balancing.
> 
> Okay. I was thinking adding where necessary and removing where not
> would lead to expected balancing.
> I will send this as a separate patch in this patch set. Is it okay to
> add a new patch to the set now?

yes, a patchset from vN to v(N + 1) is allowed to increase in patch number,
at least in my experience.

> 
> Thank you,
> deepak.
> 
> > 
> > thank you,
> > 
> > fabio 
> > 
> > >  	ret = ov2680_write_reg(client, 1,
> > >  			       OV2680_FLIP_REG, val);
> > >  	if (ret)
> > > diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > > index aec7392fd1de..d046a9804f63 100644
> > > --- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > > +++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
> > > @@ -772,9 +772,9 @@ static int ov2722_s_power(struct v4l2_subdev *sd, int on)
> > >  {
> > >  	int ret;
> > >  
> > > -	if (on == 0)
> > > +	if (on == 0) {
> > >  		return power_down(sd);
> > > -	else {
> > > +	} else {
> > >  		ret = power_up(sd);
> > >  		if (!ret)
> > >  			return ov2722_init(sd);
> > > -- 
> > > 2.25.1
> > > 
> > > 
> > > 
> > > 
> 
> 

thank you,

fabio

  reply	other threads:[~2021-04-26 17:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-25  8:40 [PATCH RESEND v3 0/6] staging: media: atomisp: code cleanup fixes Deepak R Varma
2021-04-25  8:41 ` [PATCH RESEND v3 1/6] staging: media: atomisp: improve function argument alignment Deepak R Varma
2021-04-28 11:38   ` Hans Verkuil
2021-04-25  8:42 ` [PATCH RESEND v3 2/6] staging: media: atomisp: balance braces around if...else block Deepak R Varma
2021-04-26  9:56   ` Fabio Aiuto
2021-04-26 14:30     ` Deepak R Varma
2021-04-26 17:22       ` Fabio Aiuto [this message]
2021-04-25  8:43 ` [PATCH RESEND v3 3/6] staging: media: atomisp: use __func__ over function names Deepak R Varma
2021-04-28 10:27   ` Dan Carpenter
2021-04-28 13:49     ` Deepak R Varma
2021-04-25  8:43 ` [PATCH RESEND v3 4/6] staging: media: atomisp: reformat code comment blocks Deepak R Varma
2021-04-25  8:45 ` [PATCH RESEND v3 5/6] staging: media: atomisp: fix CamelCase variable naming Deepak R Varma
2021-04-25  8:46 ` [PATCH RESEND v3 6/6] staging: media: atomisp: replace raw printk() by dev_info() Deepak R Varma

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=20210426172238.GA1409@agape.jhs \
    --to=fabioaiuto83@gmail.com \
    --cc=drv@mailo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).