Re: [PATCH v2 2/3] hwmon: (lm90) add support to handle IRQ.

From: Thierry Reding
Date: Wed Jul 10 2013 - 14:49:16 EST


On Wed, Jul 10, 2013 at 11:12:49AM -0700, Guenter Roeck wrote:
> On Wed, Jul 10, 2013 at 10:05:53AM -0700, Thierry Reding wrote:
> > On Wed, Jul 10, 2013 at 07:25:38PM +0800, Wei Ni wrote:
[...]
> > > + if ((alarms & 0x7f) == 0 && (alarms_max6696 & 0xfe) == 0) {
> > > + return IRQ_NONE;
> >
> > For non-MAX6696 chips this will evaluate to:
> >
> > if ((alarms & 0x7f) == 0 && (0 & 0xfe) == 0)
> >
> > and therefore be true for any value of "alarms" and therefore always
> > result in IRQ_NONE being returned.
> >
> Not really. If
> (alarms & 0xfe) == 0
> returns false (ie thee is an alarm) the expression is false and the
> if statement won't be executed. Or maybe I didn't get enough sleep
> last night ;).

You're right. Looks like I am the one that didn't get enough sleep last
night. =) So the original code indeed seems to be doing what it should.

Thierry

Attachment: signature.asc
Description: Digital signature