Re: [PATCH] [RFT] sh: mach-r2d: Handle virq offset in cascaded IRL demux

From: John Paul Adrian Glaubitz
Date: Sun Jul 09 2023 - 07:58:53 EST


Hi!

On Sun, 2023-07-09 at 13:15 +0200, Geert Uytterhoeven wrote:
> diff --git a/arch/sh/boards/mach-r2d/irq.c b/arch/sh/boards/mach-r2d/irq.c
> index e34f81e9ae813b8d..c37b40398c5bc83e 100644
> --- a/arch/sh/boards/mach-r2d/irq.c
> +++ b/arch/sh/boards/mach-r2d/irq.c
> @@ -117,10 +117,10 @@ static unsigned char irl2irq[R2D_NR_IRL];
>
> int rts7751r2d_irq_demux(int irq)
> {
> - if (irq >= R2D_NR_IRL || irq < 0 || !irl2irq[irq])
> + if (irq >= 16 + R2D_NR_IRL || irq < 16 || !irl2irq[irq - 16])
> return irq;
>
> - return irl2irq[irq];
> + return irl2irq[irq - 16];
> }
>
> /*

Btw, I think this needs to be adjusted to test for "ret <= 0" since IRQs cannot
be zero anymore, correct?

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mfd/sm501.c#n1389

Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913