lkml.org 
[lkml]   [2013]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/3] hwmon: (lm90) add support to handle IRQ.
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2013-07-11 00:04    [W:1.247 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site