linux/arch/powerpc/sysdev
Paul Gortmaker 0215b4aa06 powerpc: Fix build failure in sysdev/mpic.c for MPIC_WEIRD=y
Commit 446f6d06fa ("powerpc/mpic: Properly
set default triggers") breaks the mpc7447_hpc_defconfig as follows:

  CC      arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
arch/powerpc/sysdev/mpic.c:886:9: error: case label does not reduce to an integer constant
arch/powerpc/sysdev/mpic.c:890:9: error: case label does not reduce to an integer constant
arch/powerpc/sysdev/mpic.c:894:9: error: case label does not reduce to an integer constant
arch/powerpc/sysdev/mpic.c:898:9: error: case label does not reduce to an integer constant

Looking at the cpp output (gcc 4.7.3), I see:

   case mpic->hw_set[MPIC_IDX_VECPRI_SENSE_EDGE] |
        mpic->hw_set[MPIC_IDX_VECPRI_POLARITY_POSITIVE]:

The pointer into an array appears because CONFIG_MPIC_WEIRD=y is set
for this platform, thus enabling the following:

  -------------------
  #ifdef CONFIG_MPIC_WEIRD
  static u32 mpic_infos[][MPIC_IDX_END] = {
        [0] = { /* Original OpenPIC compatible MPIC */

  [...]

  #define MPIC_INFO(name) mpic->hw_set[MPIC_IDX_##name]

  #else /* CONFIG_MPIC_WEIRD */

  #define MPIC_INFO(name) MPIC_##name

  #endif /* CONFIG_MPIC_WEIRD */
  -------------------

Here we convert the case section to if/else if, and also add
the equivalent of a default case to warn about unknown types.
Boot tested on sbc8548, build tested on all defconfigs.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-02-11 11:24:45 +11:00
..
ge powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
qe_lib powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
xics powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
6xx-suspend.S
axonram.c block: Convert bio_for_each_segment() to bvec_iter 2013-11-23 22:33:49 -08:00
cpm1.c
cpm2_pic.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
cpm2_pic.h
cpm2.c
cpm_common.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
dart_iommu.c powerpc/iommu: Fix initialisation of DART iommu table 2014-01-29 16:58:49 +11:00
dart.h
dcr-low.S
dcr.c
ehv_pic.c powerpc: add missing explicit OF includes for ppc 2013-11-11 09:10:50 -06:00
fsl_85xx_cache_ctlr.h
fsl_85xx_cache_sram.c
fsl_85xx_l2ctlr.c
fsl_gtm.c Merge remote-tracking branch 'grant/devicetree/next' into for-next 2013-11-07 10:34:46 -06:00
fsl_ifc.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
fsl_lbc.c powerpc/85xx: handle the eLBC error interrupt if it exists in dts 2014-01-10 17:19:27 -06:00
fsl_mpic_err.c
fsl_mpic_timer_wakeup.c
fsl_msi.c
fsl_msi.h
fsl_pci.c powerpc/fsl_pci: add versionless pci compatible 2014-01-10 17:38:56 -06:00
fsl_pci.h
fsl_pmc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
fsl_rio.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
fsl_rio.h
fsl_rmu.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
fsl_soc.c
fsl_soc.h powerpc/mpc512x: remove unnecessary #if 2013-10-30 22:56:10 +01:00
grackle.c
i8259.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
indirect_pci.c powerpc/sysdev: Fix a pci section mismatch for Book E 2014-01-07 19:23:31 -06:00
ipic.c
ipic.h
Kconfig powerpc/powernv: Replace CONFIG_POWERNV_MSI with just CONFIG_PPC_POWERNV 2013-12-02 14:16:39 +11:00
Makefile
micropatch.c
mmio_nvram.c
mpc5xxx_clocks.c
mpc8xx_pic.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
mpc8xx_pic.h
mpic_msgr.c of/irq: Use irq_of_parse_and_map() 2013-10-24 11:50:35 +01:00
mpic_msi.c of/irq: Replace of_irq with of_phandle_args 2013-10-24 11:42:51 +01:00
mpic_pasemi_msi.c
mpic_timer.c powerpc/mpic_timer: fix convert ticks to time subtraction overflow 2014-01-09 17:52:14 -06:00
mpic_u3msi.c
mpic.c powerpc: Fix build failure in sysdev/mpic.c for MPIC_WEIRD=y 2014-02-11 11:24:45 +11:00
mpic.h
msi_bitmap.c
mv64x60_dev.c dt/bindings: Remove device_type "serial" from marvell,mv64360-mpsc 2014-01-16 16:31:31 +00:00
mv64x60_pci.c
mv64x60_pic.c
mv64x60_udbg.c dt/bindings: Remove device_type "serial" from marvell,mv64360-mpsc 2014-01-16 16:31:31 +00:00
mv64x60.h
of_rtc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
pmi.c
ppc4xx_cpm.c
ppc4xx_gpio.c
ppc4xx_msi.c
ppc4xx_ocm.c powerpc/44x: Fix ocm_block allocation 2013-12-10 11:25:04 +11:00
ppc4xx_pci.c
ppc4xx_pci.h
ppc4xx_soc.c powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
rtc_cmos_setup.c
scom.c powerpc/scom: Improve debugfs interface 2013-11-06 14:13:50 +11:00
simple_gpio.c
simple_gpio.h
tsi108_dev.c
tsi108_pci.c
udbg_memcons.c powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
uic.c
xilinx_intc.c powerpc: add missing explicit OF includes for ppc 2013-11-11 09:10:50 -06:00
xilinx_pci.c