Re: [PATCH 34/39] ARM: Bulk conversion to generic_handle_domain_irq()

From: Marc Zyngier
Date: Mon May 24 2021 - 04:32:48 EST


On Thu, 20 May 2021 19:04:17 +0100,
Rob Herring <robh@xxxxxxxxxx> wrote:
>
> On Thu, May 20, 2021 at 11:58 AM Marc Zyngier <maz@xxxxxxxxxx> wrote:
> >
> > Wherever possible, replace constructs that match either
> > generic_handle_irq(irq_find_mapping()) or
> > generic_handle_irq(irq_linear_revmap()) to a single call to
> > generic_handle_domain_irq().
> >
> > Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx>
> > ---
> > arch/arm/mach-pxa/pxa_cplds_irqs.c | 6 ++----
> > arch/arm/mach-s3c/irq-s3c24xx.c | 5 ++---
> > 2 files changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/arch/arm/mach-pxa/pxa_cplds_irqs.c b/arch/arm/mach-pxa/pxa_cplds_irqs.c
> > index ec0d9b094744..ce1bbabbad54 100644
> > --- a/arch/arm/mach-pxa/pxa_cplds_irqs.c
> > +++ b/arch/arm/mach-pxa/pxa_cplds_irqs.c
> > @@ -39,10 +39,8 @@ static irqreturn_t cplds_irq_handler(int in_irq, void *d)
> >
> > do {
> > pending = readl(fpga->base + FPGA_IRQ_SET_CLR) & fpga->irq_mask;
> > - for_each_set_bit(bit, &pending, CPLDS_NB_IRQ) {
> > - generic_handle_irq(irq_find_mapping(fpga->irqdomain,
> > - bit));
> > - }
> > + for_each_set_bit(bit, &pending, CPLDS_NB_IRQ)
> > + generic_handle_domain_irq(fpga->irqdomain, bit);
>
> We see this pattern a bit, I'm wondering if we can come up with a
> common helper. For an even longer name, something like:
>
> generic_handle_domain_irq_for_bitmap(fpga->irqdomain, &pending, CPLDS_NB_IRQ);

Maybe. However, people may want to (should?) do something when
generic_handle_domain_irq() returns an error, and this wrapper would
hide the error entirely (and being a secondary interrupt controller,
things are as non-standard as you can imagine them).

If we can come up with a common approach for most of the bitmap-driven
I'd be happy to add something to that effect. Not as part of this
series though.

Thanks,

M.

--
Without deviation from the norm, progress is not possible.