# \[PATCH\] powerpc: 52xx: provide a default in mpc52xx\_irqhost\_map()

- Subsystems: LINUX FOR POWERPC (32-BIT AND 64-BIT), LINUX FOR POWERPC EMBEDDED MPC5XXX, THE REST
- Maintainers: Madhavan Srinivasan, Anatolij Gustschin, Linus Torvalds
- List: linuxppc-dev
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linuxppc-dev/2013/08/9475814/t

## \[PATCH\] powerpc: 52xx: provide a default in mpc52xx\_irqhost\_map()

- From: Sebastian Andrzej Siewior \<bigeasy@linutronix.de\>
- Date: 2013-08-12 14:18:07 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475814.md

```text
My gcc-4.3.5 fails to compile due to:

|cc1: warnings being treated as errors
|arch/powerpc/platforms/52xx/mpc52xx_pic.c: In function ‘mpc52xx_irqhost_map’:
|arch/powerpc/platforms/52xx/mpc52xx_pic.c:343: error: ‘irqchip’ may be used uninitialized in this function

since commit e34298c ("powerpc: 52xx: nop out unsupported critical
IRQs"). This warning is complete crap since only values 0…3 are possible
which are checked but gcc fails to understand that. I wouldn't care much
but since this is compiled with -Werror I made this patch.
While add it, I replaced the warning from l2irq to l1irq since this is
the number that is evaluated.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/powerpc/platforms/52xx/mpc52xx_pic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index b89ef65..b69221b 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -373,8 +373,9 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
 	case MPC52xx_IRQ_L1_PERP: irqchip = &mpc52xx_periph_irqchip; break;
 	case MPC52xx_IRQ_L1_SDMA: irqchip = &mpc52xx_sdma_irqchip; break;
 	case MPC52xx_IRQ_L1_CRIT:
+	default:
 		pr_warn("%s: Critical IRQ #%d is unsupported! Nopping it.\n",
-			__func__, l2irq);
+			__func__, l1irq);
 		irq_set_chip(virq, &no_irq_chip);
 		return 0;
 	}
-- 
1.8.4.rc1
```

## Re: \[PATCH\] powerpc: 52xx: provide a default in mpc52xx\_irqhost\_map()

- From: Anatolij Gustschin \<agust@denx.de\>
- Date: 2013-08-12 22:17:03 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475825.md

```text
On Mon, 12 Aug 2013 16:17:53 +0200
Sebastian Andrzej Siewior [ref] wrote:

> My gcc-4.3.5 fails to compile due to:
>=20
> |cc1: warnings being treated as errors
> |arch/powerpc/platforms/52xx/mpc52xx_pic.c: In function =E2=80=98mpc52xx_=
irqhost_map=E2=80=99:
> |arch/powerpc/platforms/52xx/mpc52xx_pic.c:343: error: =E2=80=98irqchip=
=E2=80=99 may be used uninitialized in this function
>=20
> since commit e34298c ("powerpc: 52xx: nop out unsupported critical
> IRQs"). This warning is complete crap since only values 0=E2=80=A63 are p=
ossible
> which are checked but gcc fails to understand that. I wouldn't care much
> but since this is compiled with -Werror I made this patch.
> While add it, I replaced the warning from l2irq to l1irq since this is
> the number that is evaluated.
>=20
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  arch/powerpc/platforms/52xx/mpc52xx_pic.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied, thanks!

Anatolij
```
