Re: [PATCH 2/9] irqdomain: Introduce __irq_create_mapping()

From: Linus Walleij
Date: Tue Sep 24 2013 - 08:20:50 EST

On Mon, Sep 23, 2013 at 10:29 PM, Thierry Reding
<thierry.reding@xxxxxxxxx> wrote:
> On Mon, Sep 23, 2013 at 09:14:30PM +0200, Linus Walleij wrote:

>> I think it is better to first go over the call sites and make them
>> all handle negative return numbers rather than pushing the
>> obscure __interface.
> Well, the problem is that the current patch changes the signature of the
> function as well, therefore the call sites will have to be updated all
> at once in a single patch to avoid build breakage.

Hm yeah OK I see the problem, but can we atleast avoid the
__thing? Like calling the new function irq_create_mapping_strict()
or whatever.

> Another alternative could be to change the signature in a way that does
> not break compatibility. For instance I think it could work out if we
> change this function to return int instead of unsigned int but keep the
> same semantics to begin with (return 0 on failure). Then update all call
> sites to handle potential negative errors and after that return negative
> error codes.

Hm that sounds like an attractive solution to me actually.

> That still wouldn't catch any callers introduced between
> the patch creation and application.

Such things happen all the time, just have to be attentive in
what goes into linux-next...

Another minor thing:

+static int __irq_create_mapping(struct irq_domain *domain,
+ irq_hw_number_t hwirq, unsigned int *virqp)

Unless you can make a very good case for why there should
be a "v" in the beginning of virqp, then remove it and call it
"irqp" simply.

All Linux IRQs are virtual and we're already clearly separating
out those that are not by calling them "hwirq".

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