RE: [PATCH v6 03/15] irqchip/renesas-rzg2l: Drop redundant IRQC_TINT_START check in rzg2l_irqc_alloc()
From: Biju Das
Date: Mon Mar 23 2026 - 16:31:04 EST
Hi,
> -----Original Message-----
> From: Biju Das
> Sent: 23 March 2026 11:59
> Subject: RE: [PATCH v6 03/15] irqchip/renesas-rzg2l: Drop redundant IRQC_TINT_START check in
> rzg2l_irqc_alloc()
>
> Hi All,
>
> > -----Original Message-----
> > From: Biju <biju.das.au@xxxxxxxxx>
> > Sent: 22 March 2026 12:24
> > Subject: [PATCH v6 03/15] irqchip/renesas-rzg2l: Drop redundant
> > IRQC_TINT_START check in
> > rzg2l_irqc_alloc()
> >
> > From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> >
> > The check `hwirq < IRQC_TINT_START` in rzg2l_irqc_alloc() is
> > unnecessary as the condition is already guaranteed to be false at that
> > point in the code. The outer `if (hwirq > IRQC_IRQ_COUNT)` block
> > ensures that hwirq is always above IRQC_IRQ_COUNT before reaching this check, and since
> IRQC_TINT_START <= IRQC_IRQ_COUNT, the guard can never trigger.
> >
> > Remove the dead code to simplify the allocation path.
> >
> > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> > ---
> > v5->v6:
> > * No change.
> > v5:
> > * New patch.
> > ---
> > drivers/irqchip/irq-renesas-rzg2l.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/irqchip/irq-renesas-rzg2l.c
> > b/drivers/irqchip/irq-renesas-rzg2l.c
> > index e73d426cea6d..ed8044b0a339 100644
> > --- a/drivers/irqchip/irq-renesas-rzg2l.c
> > +++ b/drivers/irqchip/irq-renesas-rzg2l.c
> > @@ -491,9 +491,6 @@ static int rzg2l_irqc_alloc(struct irq_domain *domain, unsigned int virq,
> > if (hwirq > IRQC_IRQ_COUNT) {
> > tint = TINT_EXTRACT_GPIOINT(hwirq);
> > hwirq = TINT_EXTRACT_HWIRQ(hwirq);
> > -
> > - if (hwirq < IRQC_TINT_START)
> > - return -EINVAL;
>
> I am planning to drop this patch as 0x10005 is invalid for TINT IRQ This check will return proper
> error.
I will retain the patch, based on [1] this never happens.
[1] https://elixir.bootlin.com/linux/v7.0-rc5/source/drivers/pinctrl/renesas/pinctrl-rzg2l.c#L2609
Cheers,
Biju