linux/arch/powerpc/platforms
Gerhard Sittig 45d20e8348 powerpc/mpc512x: silence build warning upon disabled DIU
a disabled Kconfig option results in a reference to a not implemented
routine when the IS_ENABLED() macro is used for both conditional
implementation of the routine as well as a C language source code test
at the call site -- the "if (0) func();" construct only gets eliminated
later by the optimizer, while the compiler already has emitted its
warning about "func()" being undeclared

provide an empty implementation for the mpc512x_setup_diu() and
mpc512x_init_diu() routines in case of the disabled option, to avoid the
compiler warning which is considered fatal and breaks compilation

the bug appeared with commit 2abbbb63c9
"powerpc/mpc512x: move common code to shared.c file", how to reproduce:

  make mpc512x_defconfig
  echo CONFIG_FB_FSL_DIU=n >> .config && make olddefconfig
  make

    CC      arch/powerpc/platforms/512x/mpc512x_shared.o
  .../arch/powerpc/platforms/512x/mpc512x_shared.c: In function 'mpc512x_init_early':
  .../arch/powerpc/platforms/512x/mpc512x_shared.c:456:3: error: implicit declaration of function 'mpc512x_init_diu' [-Werror=implicit-function-declaration]
  .../arch/powerpc/platforms/512x/mpc512x_shared.c: In function 'mpc512x_setup_arch':
  .../arch/powerpc/platforms/512x/mpc512x_shared.c:469:3: error: implicit declaration of function 'mpc512x_setup_diu' [-Werror=implicit-function-declaration]
  cc1: all warnings being treated as errors
  make[4]: *** [arch/powerpc/platforms/512x/mpc512x_shared.o] Error 1

Signed-off-by: Gerhard Sittig <gsi@denx.de>
CC: <stable@vger.kernel.org> # v3.11
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2013-10-30 22:34:02 +01:00
..
8xx powerpc/8xx/tqm8xx: Fix incorrect placement of __initdata tag 2013-10-11 16:49:00 +11:00
40x Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
44x i2c: move OF helpers into the core 2013-08-23 10:22:20 +02:00
52xx powerpc: 52xx: provide a default in mpc52xx_irqhost_map() 2013-08-13 00:16:04 +02:00
82xx powerpc/82xx: fix checkpatch warnings for km82xx.c 2013-02-13 07:49:04 -06:00
83xx arch/powerpc/platforms/83xx: Remove obsolete cleanup for clientdata 2013-10-28 21:11:23 -05:00
85xx powerpc/p1010rdb: add P1010RDB-PB platform support 2013-10-28 21:11:23 -05:00
86xx powerpc: remove redundant GENERIC_GPIO selection 2013-03-20 22:48:15 +09:00
512x powerpc/mpc512x: silence build warning upon disabled DIU 2013-10-30 22:34:02 +01:00
amigaone pcspkr: Cleanup Kconfig dependencies 2011-06-09 15:01:41 +02:00
cell xfs: update for v3.12-rc1 2013-09-09 11:19:09 -07:00
chrp mv643xx_eth: convert to use the Marvell Orion MDIO driver 2013-03-22 10:25:15 -04:00
embedded6xx powerpc/6xx: add missing iounmap() on error in hlwd_pic_init() 2013-10-28 21:11:22 -05:00
maple POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pasemi cpufreq: powerpc: move cpufreq driver to drivers/cpufreq 2013-06-07 13:44:39 +02:00
powermac irqdomain refactoring for v3.11 2013-07-06 12:37:04 -07:00
powernv powerpc/powernv: Code update interface 2013-10-30 16:12:02 +11:00
ps3 PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. 2013-07-15 11:25:01 +09:30
pseries powerpc/pseries: Fix endian issues in pseries iommu code 2013-10-30 16:01:10 +11:00
wsp powerpc/scom: Change scom_read() and scom_write() to return errors 2013-10-11 16:53:34 +11:00
fsl_uli1575.c POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
Kconfig powerpc: Better split CONFIG_PPC_INDIRECT_PIO and CONFIG_PPC_INDIRECT_MMIO 2013-08-14 14:57:50 +10:00
Kconfig.cputype powerpc: Use -mcpu=power7 on ppc64 little endian builds 2013-10-30 16:01:50 +11:00
Makefile powerpc: Remove the main legacy iSerie platform code 2012-03-09 10:35:11 +11:00