lkml.org 
[lkml]   [2011]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [lm-sensors] [PATCH] Add support for the Philips SA56004 temperature sensor.
Date
From
> -----Original Message-----
> From: Guenter Roeck [mailto:guenter.roeck@ericsson.com]
>
> > if (!name) { /* identification failed */
> > @@ -1372,6 +1401,18 @@ static int lm90_probe(struct i2c_client
> *new_client,
> > /* Set maximum conversion rate */
> > data->max_convrate = lm90_params[data->kind].max_convrate;
> >
> > + if (data->flags & LM90_HAVE_LOCAL_EXT) {
> > + if (lm90_params[data->kind].local_ext_offset > 0)
> > + data->local_ext_offset =
> > +
lm90_params[data->kind].local_ext_offset;
> > + else {
> > + dev_err(&new_client->dev,
> > + "Invalid temperature extension register. "
> > + "Accuracy may be limited.\n");
> > + data->flags &= (~LM90_HAVE_LOCAL_EXT);
> > + }
>
> Either { } in both branches of the if statement, or none.
> ( ) around ~LM90_HAVE_LOCAL_EXT is unnecessary.
>
> I see it as BUG if LM90_HAVE_LOCAL_EXT is set but local_ext_offset
isn't.
> That should be found during coding (or code review), and not be
exported
> to the user. So, from my perspective, the check is unnecessary. I'll
leave
> that up to Jean to decide, though.
>
Do you think a BUG_ON() would be better suited here?

> In addition to the above, your patch generates several checkpatch
errors
> (trailing whitespace). Please fix.
I recall letting checkpatch yell at me... I'll have another round of it
to
be sure.

Thanks,
Stijn


\
 
 \ /
  Last update: 2011-05-23 09:11    [W:0.088 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site