linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] trivial: adjust code alignment
       [not found]   ` <20130805160645.GI5051@mwanda>
@ 2013-08-05 16:19     ` Julia Lawall
  2013-08-05 16:24       ` walter harms
  2013-08-05 16:52       ` Jonathan Corbet
  0 siblings, 2 replies; 5+ messages in thread
From: Julia Lawall @ 2013-08-05 16:19 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: trivial, kernel-janitors, corbet, m.chehab, linux-media,
	linux-kernel

On Mon, 5 Aug 2013, Dan Carpenter wrote:

> On Mon, Aug 05, 2013 at 04:47:39PM +0200, Julia Lawall wrote:
>> diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
>> index e8a1ce2..4a5a5dc 100644
>> --- a/drivers/media/i2c/ov7670.c
>> +++ b/drivers/media/i2c/ov7670.c
>> @@ -1369,8 +1369,8 @@ static int ov7670_s_exp(struct v4l2_subdev *sd, int value)
>>  	unsigned char com1, com8, aech, aechh;
>>
>>  	ret = ov7670_read(sd, REG_COM1, &com1) +
>> -		ov7670_read(sd, REG_COM8, &com8);
>> -		ov7670_read(sd, REG_AECHH, &aechh);
>> +	ov7670_read(sd, REG_COM8, &com8);
>> +	ov7670_read(sd, REG_AECHH, &aechh);
>>  	if (ret)
>>  		return ret;
>>
>
> The new indenting isn't correct here and anyway the intent was to
> combine all the error codes together and return them as an error
> code jumble.  I'm not a fan of error code jumbles, probably the
> right thing is to check each function call or, barring that, to
> return -EIO.

Oops, thanks for spotting that.  I'm not sure whether it is safe to abort 
these calls as soon as the first one fails, but perhaps I could introduce 
some more variables, and test them all afterwards.

What should I do with the big patch?  Resend it with this cut out?  Or, 
considering that I might have overlooked something else, send 90 some 
little ones?

thanks,
julia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] trivial: adjust code alignment
  2013-08-05 16:19     ` [PATCH] trivial: adjust code alignment Julia Lawall
@ 2013-08-05 16:24       ` walter harms
  2013-08-05 16:28         ` Julia Lawall
  2013-08-05 17:05         ` Dan Carpenter
  2013-08-05 16:52       ` Jonathan Corbet
  1 sibling, 2 replies; 5+ messages in thread
From: walter harms @ 2013-08-05 16:24 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Dan Carpenter, trivial, kernel-janitors, corbet, m.chehab,
	linux-media, linux-kernel

Hello Julia,

IMHO keep the patch as it is.
It does not change any code that is good.
Suspicious code that comes up here can be addressed
in a separate patch.

just my 2 cents,
re,
 wh

Am 05.08.2013 18:19, schrieb Julia Lawall:
> On Mon, 5 Aug 2013, Dan Carpenter wrote:
> 
>> On Mon, Aug 05, 2013 at 04:47:39PM +0200, Julia Lawall wrote:
>>> diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
>>> index e8a1ce2..4a5a5dc 100644
>>> --- a/drivers/media/i2c/ov7670.c
>>> +++ b/drivers/media/i2c/ov7670.c
>>> @@ -1369,8 +1369,8 @@ static int ov7670_s_exp(struct v4l2_subdev *sd,
>>> int value)
>>>      unsigned char com1, com8, aech, aechh;
>>>
>>>      ret = ov7670_read(sd, REG_COM1, &com1) +
>>> -        ov7670_read(sd, REG_COM8, &com8);
>>> -        ov7670_read(sd, REG_AECHH, &aechh);
>>> +    ov7670_read(sd, REG_COM8, &com8);
>>> +    ov7670_read(sd, REG_AECHH, &aechh);
>>>      if (ret)
>>>          return ret;
>>>
>>
>> The new indenting isn't correct here and anyway the intent was to
>> combine all the error codes together and return them as an error
>> code jumble.  I'm not a fan of error code jumbles, probably the
>> right thing is to check each function call or, barring that, to
>> return -EIO.
> 
> Oops, thanks for spotting that.  I'm not sure whether it is safe to
> abort these calls as soon as the first one fails, but perhaps I could
> introduce some more variables, and test them all afterwards.
> 
> What should I do with the big patch?  Resend it with this cut out?  Or,
> considering that I might have overlooked something else, send 90 some
> little ones?
> 
> thanks,
> julia
> -- 
> To unsubscribe from this list: send the line "unsubscribe
> kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] trivial: adjust code alignment
  2013-08-05 16:24       ` walter harms
@ 2013-08-05 16:28         ` Julia Lawall
  2013-08-05 17:05         ` Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2013-08-05 16:28 UTC (permalink / raw)
  To: walter harms
  Cc: Julia Lawall, Dan Carpenter, trivial, kernel-janitors, corbet,
	m.chehab, linux-media, linux-kernel

On Mon, 5 Aug 2013, walter harms wrote:

> Hello Julia,
>
> IMHO keep the patch as it is.
> It does not change any code that is good.
> Suspicious code that comes up here can be addressed
> in a separate patch.

OK, thanks!

julia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] trivial: adjust code alignment
  2013-08-05 16:19     ` [PATCH] trivial: adjust code alignment Julia Lawall
  2013-08-05 16:24       ` walter harms
@ 2013-08-05 16:52       ` Jonathan Corbet
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2013-08-05 16:52 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Dan Carpenter, trivial, kernel-janitors, m.chehab, linux-media,
	linux-kernel

On Mon, 5 Aug 2013 18:19:18 +0200 (CEST)
Julia Lawall <julia.lawall@lip6.fr> wrote:

> Oops, thanks for spotting that.  I'm not sure whether it is safe to abort 
> these calls as soon as the first one fails, but perhaps I could introduce 
> some more variables, and test them all afterwards.

Yes, it would be safe.  But it's hard to imagine a scenario where any of
those particular calls would fail that doesn't involve smoke.

The code is evidence of ancient laziness on my part.  I'll add fixing it
up to my list of things to do.

Thanks,

jon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] trivial: adjust code alignment
  2013-08-05 16:24       ` walter harms
  2013-08-05 16:28         ` Julia Lawall
@ 2013-08-05 17:05         ` Dan Carpenter
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2013-08-05 17:05 UTC (permalink / raw)
  To: walter harms
  Cc: Julia Lawall, trivial, kernel-janitors, corbet, m.chehab,
	linux-media, linux-kernel

On Mon, Aug 05, 2013 at 06:24:43PM +0200, walter harms wrote:
> Hello Julia,
> 
> IMHO keep the patch as it is.
> It does not change any code that is good.
> Suspicious code that comes up here can be addressed
> in a separate patch.
> 

Gar... No, if we silence static checker warnings without fixing the
bug then we are hiding real problems and making them more difficult
to find.

Just drop this chunk.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-05 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1375714059-29567-1-git-send-email-Julia.Lawall@lip6.fr>
     [not found] ` <1375714059-29567-5-git-send-email-Julia.Lawall@lip6.fr>
     [not found]   ` <20130805160645.GI5051@mwanda>
2013-08-05 16:19     ` [PATCH] trivial: adjust code alignment Julia Lawall
2013-08-05 16:24       ` walter harms
2013-08-05 16:28         ` Julia Lawall
2013-08-05 17:05         ` Dan Carpenter
2013-08-05 16:52       ` Jonathan Corbet

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