Re: [PATCH 2/2] x86: of: define irq functions to allow drivers/of/*to build on x86

From: Grant Likely
Date: Tue Sep 21 2010 - 15:27:31 EST


On Tue, Sep 21, 2010 at 1:27 PM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> On Tue, 21 Sep 2010, Andres Salomon wrote:
>> On Tue, 21 Sep 2010 11:45:37 +0200 (CEST)
>> Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>>
>> > > Any additional comments (ACKs, NACKs, etc) on the patches?  If I
>> > > need to rework it (or them), I can certainly make the patch
>> > > description longer.
>> >
>> > Fine with me, but you could make the "mapping" function an inline as
>> > well. While at it, some sensible changelog would be helpful :)
>> >
>> > Thanks,
>> >
>> >     tglx
>>
>> Hm, inlining it would require some additional x86 #ifdefs in
>> include/linux/of_irq.h (where the mapping function is declared).  You'd
>> prefer that?
>
> Urgh, no.

In OF code, I *have* been moving to the following pattern when the OF
code has a sane default:

#ifndef <symbol>
static inline <symbol>(...)
{
<default implementation>
}
#define <symbol> <symbol>
#endif

I'd normally be totally okay with this in of_irq.h, except for the
fact that this implementation is a temporary solution. Once I've got
the irq remapping code generalized for all architecture then the map
function could become a static inline in this form.

Fortunately, this code should never be on a hot path.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/