Messages in this thread | | | Date | Thu, 24 Apr 2008 09:58:52 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [git patch] free_irq() fixes |
| |
On Thu, 24 Apr 2008, Eric W. Biederman wrote: > > Right now the irq number is very much an array index and that > property is limiting.
That's simply not true.
You are looking at some implementation detail, but other architectures have used other notions.
The number is just that: a number. Nothing else. If you think it's an array index, you are looking at it in all the wrong ways.
So you're now complaining about somethign totally different than the type, you're talking about simple implementation issues.
And the reason it's generally implemented as a vector is very simple: it's basic to the whole notion that the hardware gives us some cookie (which itself is _often_ a small number, but sometimes is something that we can program), and we want to look up that cookie into our internal irq handling data structures.
So even when we can program the hw cookie arbitrarily (eg MSI), we actually tend to *want* to program it with something we can use as an array index, simply because that's often the best way to then map the hardware cookie into the internal "struct irq_desc" things.
So your argument MAKES ABSOLUTELY NO SENSE!
The reason we use something that _looks_ like an array index is that we ourself (and hardware) MADE IT SO.
It has absolutely nothing to do with the type of "irq". Even if "irq" was a pointer to a struct, we'd *still* want to have that array-index-like thing, and the only thing you could do would be to then use an extra level of indirection to turn it into something else!
So "irq" looks like an array index because we _avoid_ the indirection (except for the lookup of "irq_desc", which we absolutely do NOT want to expose to drivers!)
Your argument is utter crap, in other words. It makes no sense.
Linus
| |