* [PATCH] powerpc/mpic: Fix build errors for CONFIG_MPIC_WEIRD
@ 2014-01-20 19:42 Luis Henriques
0 siblings, 0 replies; only message in thread
From: Luis Henriques @ 2014-01-20 19:42 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Grant Likely, Rob Herring,
Scott Wood, Wang Dongsheng, Jia Hongtao, Alexander Gordeev
Cc: devicetree, linuxppc-dev, linux-kernel
When CONFIG_MPIC_WEIRD is defined, the following build error occurs:
arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
arch/powerpc/sysdev/mpic.c:892:9: error: case label does not reduce to an integer constant
MPIC_INFO(VECPRI_POLARITY_POSITIVE):
^
arch/powerpc/sysdev/mpic.c:896:9: error: case label does not reduce to an integer constant
MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
^
arch/powerpc/sysdev/mpic.c:900:9: error: case label does not reduce to an integer constant
MPIC_INFO(VECPRI_POLARITY_POSITIVE):
^
arch/powerpc/sysdev/mpic.c:904:9: error: case label does not reduce to an integer constant
MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
^
This is because the case labels are built by accessing mpic->hw_set, and not an
integer constant.
Fixes: 446f6d06fab0 ("powerpc/mpic: Properly set default triggers")
Cc: <stable@vger.kernel.org> (3.4+)
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
arch/powerpc/sysdev/mpic.c | 34 +++++++++++++++-------------------
1 file changed, 15 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 0e166ed..e7bf1a2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -886,25 +886,21 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type)
/* Default: read HW settings */
if (flow_type == IRQ_TYPE_DEFAULT) {
- switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
- MPIC_INFO(VECPRI_SENSE_MASK))) {
- case MPIC_INFO(VECPRI_SENSE_EDGE) |
- MPIC_INFO(VECPRI_POLARITY_POSITIVE):
- flow_type = IRQ_TYPE_EDGE_RISING;
- break;
- case MPIC_INFO(VECPRI_SENSE_EDGE) |
- MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
- flow_type = IRQ_TYPE_EDGE_FALLING;
- break;
- case MPIC_INFO(VECPRI_SENSE_LEVEL) |
- MPIC_INFO(VECPRI_POLARITY_POSITIVE):
- flow_type = IRQ_TYPE_LEVEL_HIGH;
- break;
- case MPIC_INFO(VECPRI_SENSE_LEVEL) |
- MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
- flow_type = IRQ_TYPE_LEVEL_LOW;
- break;
- }
+ unsigned int info;
+ info = vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
+ MPIC_INFO(VECPRI_SENSE_MASK));
+ if (info == (MPIC_INFO(VECPRI_SENSE_EDGE) |
+ MPIC_INFO(VECPRI_POLARITY_POSITIVE)))
+ flow_type = IRQ_TYPE_EDGE_RISING;
+ else if (info == (MPIC_INFO(VECPRI_SENSE_EDGE) |
+ MPIC_INFO(VECPRI_POLARITY_NEGATIVE)))
+ flow_type = IRQ_TYPE_EDGE_FALLING;
+ else if (info == (MPIC_INFO(VECPRI_SENSE_LEVEL) |
+ MPIC_INFO(VECPRI_POLARITY_POSITIVE)))
+ flow_type = IRQ_TYPE_LEVEL_HIGH;
+ else if (info == (MPIC_INFO(VECPRI_SENSE_LEVEL) |
+ MPIC_INFO(VECPRI_POLARITY_NEGATIVE)))
+ flow_type = IRQ_TYPE_LEVEL_LOW;
}
/* Apply to irq desc */
--
1.8.3.2
Cheers,
--
Luis
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-01-20 19:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 19:42 [PATCH] powerpc/mpic: Fix build errors for CONFIG_MPIC_WEIRD Luis Henriques
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).