2020-11-24 09:21:57

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH kernel v4 2/8] genirq/irqdomain: Clean legacy IRQ allocation

On Tue, Nov 24, 2020 at 8:20 AM Alexey Kardashevskiy <[email protected]> wrote:
>
> There are 10 users of __irq_domain_alloc_irqs() and only one - IOAPIC -
> passes realloc==true. There is no obvious reason for handling this
> specific case in the generic code.
>
> This splits out __irq_domain_alloc_irqs_data() to make it clear what
> IOAPIC does and makes __irq_domain_alloc_irqs() cleaner.
>
> This should cause no behavioral change.

> + ret = __irq_domain_alloc_irqs_data(domain, virq, nr_irqs, node, arg, affinity);
> + if (ret <= 0)
> goto out_free_desc;

Was or wasn't 0 considered as error code previously?

> return virq;

> out_free_desc:
> irq_free_descs(virq, nr_irqs);
> return ret;

--
With Best Regards,
Andy Shevchenko


2020-11-24 21:12:09

by Alexey Kardashevskiy

[permalink] [raw]
Subject: Re: [PATCH kernel v4 2/8] genirq/irqdomain: Clean legacy IRQ allocation



On 11/24/20 8:19 PM, Andy Shevchenko wrote:
> On Tue, Nov 24, 2020 at 8:20 AM Alexey Kardashevskiy <[email protected]> wrote:
>>
>> There are 10 users of __irq_domain_alloc_irqs() and only one - IOAPIC -
>> passes realloc==true. There is no obvious reason for handling this
>> specific case in the generic code.
>>
>> This splits out __irq_domain_alloc_irqs_data() to make it clear what
>> IOAPIC does and makes __irq_domain_alloc_irqs() cleaner.
>>
>> This should cause no behavioral change.
>
>> + ret = __irq_domain_alloc_irqs_data(domain, virq, nr_irqs, node, arg, affinity);
>> + if (ret <= 0)
>> goto out_free_desc;
>
> Was or wasn't 0 considered as error code previously?

Oh. I need to clean this up, the idea is since this does not allocate
IRQs, this should return error code and not an irq, I'll make this explicit.

>
>> return virq;
>
>> out_free_desc:
>> irq_free_descs(virq, nr_irqs);
>> return ret;
>

--
Alexey