alistair23-linux/arch/powerpc/platforms/512x
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
..
clock.c powerpc/mpc512x: add platform code for MPC5125. 2013-04-10 20:37:43 +02:00
Kconfig Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-05-02 10:16:16 -07:00
Makefile powerpc/512x: move mpc5121_generic platform to mpc512x_generic. 2013-04-01 09:25:00 +02:00
mpc512x.h powerpc/mpc512x: add MPC5125 reset module support for system restart 2013-06-24 21:36:49 +02:00
mpc512x_generic.c powerpc/mpc512x: move common code to shared.c file 2013-05-21 10:58:39 +02:00
mpc512x_shared.c powerpc/mpc512x: silence build warning upon disabled DIU 2013-10-30 22:34:02 +01:00
mpc5121_ads.c powerpc/mpc512x: move common code to shared.c file 2013-05-21 10:58:39 +02:00
mpc5121_ads.h
mpc5121_ads_cpld.c
pdm360ng.c powerpc/mpc512x: move common code to shared.c file 2013-05-21 10:58:39 +02:00