[lkml]   [2005]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH 4/5] Centralise NO_IRQ definition

    * Linus Torvalds <> wrote:

    > At which point you might as well just do something like
    > struct interrupt_descriptor {
    > unsigned int nr:31;
    > unsigned int valid:1;
    > };
    > and then people can just say
    > if (!dev->irq.valid)
    > return;
    > instead, which is also readable, and where you simply cannot do the old
    > "if (!dev->irq)" at all.
    > The fact is, 0 _is_ special. Not just for hardware, but because 0 has
    > a magical meaning as "false" in the C language.

    yeah, i wanted to suggest this originally, but got distracted by the x86
    quirk that 'IRQ#0' is often the i8253 timer interrupt.

    is there any architecture where irq 0 is a legitimate setting that could
    occur in drivers, and which would make NO_IRQ define of 0 non-practical?
    If not (which i think is the case) then we should indeed standardize on
    0. (in one way or another) It's not like any real driver will ever have
    IRQ#0 even on a PC: the timer IRQ is 'known' to be routed to 0, and we
    do a platform-specific setup_irq() on it. Not a good reason to abstract
    the notion of 'no irq' away into a define.

    in fact we dont even have to do the irq.valid thing, !dev->irq is
    obviously readable.

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-11-21 22:18    [W:0.021 / U:10.512 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site