lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Wed, 20 Aug 2008 01:12:10 +0400 From: Anton Vorontsov <avorontsov@...mvista.com> To: Jon Smirl <jonsmirl@...il.com> Cc: Alessandro Zummo <a.zummo@...ertech.it>, Andrew Morton <akpm@...ux-foundation.org>, linuxppc-dev@...abs.org, linux-kernel@...r.kernel.org, rtc-linux@...glegroups.com Subject: Re: [PATCH 1/2] rtc: rtc-ds1374: fix 'no irq' case handling On Tue, Aug 19, 2008 at 04:39:09PM -0400, Jon Smirl wrote: > On 8/12/08, Anton Vorontsov <avorontsov@...mvista.com> wrote: > > On a PowerPC board with ds1374 RTC I'm getting this error while > > RTC tries to probe: > > > > rtc-ds1374 0-0068: unable to request IRQ > > > > This happens because I2C probing code (drivers/of/of_i2c.c) is > > specifying IRQ0 for 'no irq' case, which is correct. > > Shouldn't this be > > > - if (client->irq <= NO_IRQ) > > instead of > > > - if (client->irq < 0) > > + if (client->irq <= 0) > > Since NO_IRQ can vary by platform (0 or -1)? First of all, NO_IRQ is not defined for every architecture. You can't use it for truly cross-platform drivers. Secondly, "<= 0" will work for both NO_IRQ == 0 and NO_IRQ == -1, since client->irq is signed type. As for false positives, I don't believe that there is any platform that use IRQ0 for external interrupts. [...] > In of_i2c.c shouldn't there be an error check? > > info.irq = irq_of_parse_and_map(node, 0); > > if (info.irq < NO_IRQ) {report error; continue } irq_of_parse_and_map() returns unsigned type, plus it is defined only for PowerPC, and for PowerPC NO_IRQ is always 0. -- Anton Vorontsov email: cbouatmailru@...il.com irc://irc.freenode.net/bd2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists