* [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
@ 2013-10-01 7:26 Wolfram Sang
2013-10-01 7:54 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2013-10-01 7:26 UTC (permalink / raw)
To: linuxppc-dev
Cc: Sebastian Andrzej Siewior, Anatolij Gustschin, linux-rt-users,
Wolfram Sang
This reverts commit 6391f697d4892a6f233501beea553e13f7745a23. The
compiler warning it wants to fix does not appear with my gcc 4.6.2. IMO
we don't need superfluous (and here even misleading) code to make old
compilers happy. Fixing the printout was bogus, too. We want to know
WHICH critical irq failed, not which level it had.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Anatolij Gustschin <agust@denx.de>
---
Have I been on CC when the original patch was sent?
arch/powerpc/platforms/52xx/mpc52xx_pic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index b69221b..b89ef65 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -373,9 +373,8 @@ 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__, l1irq);
+ __func__, l2irq);
irq_set_chip(virq, &no_irq_chip);
return 0;
}
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
2013-10-01 7:26 [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()" Wolfram Sang
@ 2013-10-01 7:54 ` Sebastian Andrzej Siewior
2013-10-01 9:11 ` Wolfram Sang
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-01 7:54 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, Anatolij Gustschin, linux-rt-users
On 10/01/2013 09:26 AM, Wolfram Sang wrote:
> This reverts commit 6391f697d4892a6f233501beea553e13f7745a23. The
> compiler warning it wants to fix does not appear with my gcc 4.6.2. IMO
> we don't need superfluous (and here even misleading) code to make old
> compilers happy. Fixing the printout was bogus, too. We want to know
> WHICH critical irq failed, not which level it had.
According to minimal Doc*/Changes minimal gcc is 3.2. Mine was 4.3.5.
Why miss leading code? Default here does the same as unhandled and crit
where it does nothing. Any why do you want to see l2irq since it was
not in the case statement? l2 holds the number, l1 the level.
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
>
> Have I been on CC when the original patch was sent?
You were but your email bounced. I wasn't aware of this new email
address you are using now.
>
> arch/powerpc/platforms/52xx/mpc52xx_pic.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
> index b69221b..b89ef65 100644
> --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
> @@ -373,9 +373,8 @@ 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__, l1irq);
> + __func__, l2irq);
> irq_set_chip(virq, &no_irq_chip);
> return 0;
> }
>
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
2013-10-01 7:54 ` Sebastian Andrzej Siewior
@ 2013-10-01 9:11 ` Wolfram Sang
2013-10-01 16:32 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2013-10-01 9:11 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linuxppc-dev, Anatolij Gustschin, linux-rt-users
[-- Attachment #1: Type: text/plain, Size: 2136 bytes --]
Hi,
On Tue, Oct 01, 2013 at 09:54:51AM +0200, Sebastian Andrzej Siewior wrote:
> On 10/01/2013 09:26 AM, Wolfram Sang wrote:
> > This reverts commit 6391f697d4892a6f233501beea553e13f7745a23. The
> > compiler warning it wants to fix does not appear with my gcc 4.6.2. IMO
> > we don't need superfluous (and here even misleading) code to make old
> > compilers happy. Fixing the printout was bogus, too. We want to know
> > WHICH critical irq failed, not which level it had.
>
> According to minimal Doc*/Changes minimal gcc is 3.2. Mine was 4.3.5.
Well, if you insist, I'd prefer the following patch.
From: Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH] ppc: mpc52xx: silence false positive from old GCC
So people can compile with -Werror (RT patchset).
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
arch/powerpc/platforms/52xx/mpc52xx_pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index b89ef65..ad3c9b0 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -340,7 +340,7 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
{
int l1irq;
int l2irq;
- struct irq_chip *irqchip;
+ struct irq_chip *irqchip = NULL; /* pet old compilers */
void *hndlr;
int type;
u32 reg;
> Why miss leading code? Default here does the same as unhandled and crit
> where it does nothing.
People not realizing 'default' is a no-op might wonder why unknown
levels are mapped to critical.
> Any why do you want to see l2irq since it was
> not in the case statement? l2 holds the number, l1 the level.
We know which level it was, since the printout is only for that level.
We probably want to know which requested IRQ was causing this, so we can
fix the assorted driver. Otherwise we only know that some critical IRQ
was requested somewhere.
> You were but your email bounced. I wasn't aware of this new email
> address you are using now.
Ah, I see, pity.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
2013-10-01 9:11 ` Wolfram Sang
@ 2013-10-01 16:32 ` Sebastian Andrzej Siewior
2013-10-01 19:03 ` Wolfram Sang
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-01 16:32 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, Anatolij Gustschin, linux-rt-users
On 10/01/2013 11:11 AM, Wolfram Sang wrote:
> Hi,
Hi Wolfram,
> Well, if you insist, I'd prefer the following patch.
>
> From: Wolfram Sang <wsa@the-dreams.de> Subject: [PATCH] ppc:
> mpc52xx: silence false positive from old GCC
>
> So people can compile with -Werror (RT patchset).
Why do you mention the RT patch set here? Doesn't the vanila tree gets
compiled with -Werror as well?
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> ---
> arch/powerpc/platforms/52xx/mpc52xx_pic.c | 2 +- 1 file changed,
> 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
> b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index b89ef65..ad3c9b0
> 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++
> b/arch/powerpc/platforms/52xx/mpc52xx_pic.c @@ -340,7 +340,7 @@
> static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int
> virq, { int l1irq; int l2irq; - struct irq_chip *irqchip; + struct
> irq_chip *irqchip = NULL; /* pet old compilers */
That would probably work, too. I would drop that comment but then
someone might clean that up :P
> void *hndlr; int type; u32 reg;
>
>> Why miss leading code? Default here does the same as unhandled
>> and crit where it does nothing.
>
> People not realizing 'default' is a no-op might wonder why unknown
> levels are mapped to critical.
I see. And what would you suggest as default in case we would have an
additional bit?
>
>> Any why do you want to see l2irq since it was not in the case
>> statement? l2 holds the number, l1 the level.
>
> We know which level it was, since the printout is only for that
> level. We probably want to know which requested IRQ was causing
> this, so we can fix the assorted driver. Otherwise we only know
> that some critical IRQ was requested somewhere.
Hmmm. I assumed that critical / SDMA / … are interrupt numbers but they
are seem not be. In that case I guess l2 is more important. l1 kinda
looks important since it is the value in the switch case which failed
but since it can only hold one possible value, I guess your info is
better :)
>
> Thanks,
>
> Wolfram
>
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
2013-10-01 16:32 ` Sebastian Andrzej Siewior
@ 2013-10-01 19:03 ` Wolfram Sang
2013-10-02 7:12 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2013-10-01 19:03 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linuxppc-dev, Anatolij Gustschin, linux-rt-users
[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]
> > So people can compile with -Werror (RT patchset).
>
> Why do you mention the RT patch set here? Doesn't the vanila tree gets
> compiled with -Werror as well?
Not for me.
> > irq_chip *irqchip = NULL; /* pet old compilers */
>
> That would probably work, too. I would drop that comment but then
> someone might clean that up :P
Yup. But I just remembered a better solution:
From: Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH] ppc: mpc52xx: silence false positive from old GCC
So people can compile with -Werror.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
arch/powerpc/platforms/52xx/mpc52xx_pic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index b89ef65..2898b73 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -340,7 +340,7 @@ static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int virq,
{
int l1irq;
int l2irq;
- struct irq_chip *irqchip;
+ struct irq_chip *uninitialized_var(irqchip);
void *hndlr;
int type;
u32 reg;
uninitialized_var was created for exactly that purpose IIRC.
> > People not realizing 'default' is a no-op might wonder why unknown
> > levels are mapped to critical.
>
> I see. And what would you suggest as default in case we would have an
> additional bit?
-Esome or a different error message. But let's postpone that until that
case happens ;)
> Hmmm. I assumed that critical / SDMA / … are interrupt numbers but they
> are seem not be. In that case I guess l2 is more important. l1 kinda
> looks important since it is the value in the switch case which failed
> but since it can only hold one possible value, I guess your info is
> better :)
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()"
2013-10-01 19:03 ` Wolfram Sang
@ 2013-10-02 7:12 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-02 7:12 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linuxppc-dev, Anatolij Gustschin, linux-rt-users
On 10/01/2013 09:03 PM, Wolfram Sang wrote:
>
> Yup. But I just remembered a better solution:
>
> From: Wolfram Sang <wsa@the-dreams.de> Subject: [PATCH] ppc:
> mpc52xx: silence false positive from old GCC
>
> So people can compile with -Werror.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> ---
> arch/powerpc/platforms/52xx/mpc52xx_pic.c | 2 +- 1 file changed,
> 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
> b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index b89ef65..2898b73
> 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++
> b/arch/powerpc/platforms/52xx/mpc52xx_pic.c @@ -340,7 +340,7 @@
> static int mpc52xx_irqhost_map(struct irq_domain *h, unsigned int
> virq, { int l1irq; int l2irq; - struct irq_chip *irqchip; + struct
> irq_chip *uninitialized_var(irqchip); void *hndlr; int type; u32
> reg;
>
>
> uninitialized_var was created for exactly that purpose IIRC.
Yup, looks good, thanks.
>
> Thanks,
>
> Wolfram
>
Sebastian
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-10-02 7:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-01 7:26 [PATCH] Revert "powerpc: 52xx: provide a default in mpc52xx_irqhost_map()" Wolfram Sang
2013-10-01 7:54 ` Sebastian Andrzej Siewior
2013-10-01 9:11 ` Wolfram Sang
2013-10-01 16:32 ` Sebastian Andrzej Siewior
2013-10-01 19:03 ` Wolfram Sang
2013-10-02 7:12 ` Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).