Patchwork [3.11.y.z,extended,stable] Patch "powerpc/mpc512x: silence build warning upon disabled DIU" has been added to staging queue

mail settings
Submitter Luis Henriques
Date Dec. 5, 2013, 11:27 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/297059/
State New
Headers show


Luis Henriques - Dec. 5, 2013, 11:27 a.m.
This is a note to let you know that I have just added a patch titled

    powerpc/mpc512x: silence build warning upon disabled DIU

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see



From 8e508b8396b36a06acbba56dbdd586b6af0cc948 Mon Sep 17 00:00:00 2001
From: Gerhard Sittig <>
Date: Fri, 27 Sep 2013 17:28:38 +0200
Subject: powerpc/mpc512x: silence build warning upon disabled DIU

commit 45d20e8348969a165c53cfb91f445e7cc599a9f0 upstream.

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 2abbbb63c90ab55ca3f054772c2e5ba7df810c48
"powerpc/mpc512x: move common code to shared.c file", how to reproduce:

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

    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 <>
Signed-off-by: Anatolij Gustschin <>
Signed-off-by: Luis Henriques <>
 arch/powerpc/platforms/512x/mpc512x_shared.c | 3 +++
 1 file changed, 3 insertions(+)



diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c
index a82a41b..1a7b1d0 100644
--- a/arch/powerpc/platforms/512x/mpc512x_shared.c
+++ b/arch/powerpc/platforms/512x/mpc512x_shared.c
@@ -303,6 +303,9 @@  void __init mpc512x_setup_diu(void)
 	diu_ops.release_bootmem		= mpc512x_release_bootmem;

+void __init mpc512x_setup_diu(void) { /* EMPTY */ }
+void __init mpc512x_init_diu(void) { /* EMPTY */ }

 void __init mpc512x_init_IRQ(void)