diff mbox

[U-Boot] zmx25: Fix build warning by defining CONFIG_DISPLAY_CPUINFO

Message ID 1316779666-25806-1-git-send-email-fabio.estevam@freescale.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam Sept. 23, 2011, 12:07 p.m. UTC
When building the zmx25 target we get:

Configuring for zmx25 board...
generic.c:108: warning: 'get_reset_cause' defined but not used

Fix this warning by defining CONFIG_DISPLAY_CPUINFO in the board config file.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 include/configs/zmx25.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Stefano Babic Sept. 23, 2011, 1:02 p.m. UTC | #1
On 09/23/2011 02:07 PM, Fabio Estevam wrote:
> When building the zmx25 target we get:
> 
> Configuring for zmx25 board...
> generic.c:108: warning: 'get_reset_cause' defined but not used
> 

Hi Fabio,

> Fix this warning by defining CONFIG_DISPLAY_CPUINFO in the board config file.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  include/configs/zmx25.h |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/include/configs/zmx25.h b/include/configs/zmx25.h
> index 374c88a..0c217b8 100644
> --- a/include/configs/zmx25.h
> +++ b/include/configs/zmx25.h
> @@ -32,6 +32,8 @@
>  #define CONFIG_SYS_HZ			1000
>  #define CONFIG_SYS_TEXT_BASE		0xA0000000
>  
> +#define CONFIG_DISPLAY_CPUINFO
> +
>  /*
>   * Environment settings
>   */

Wait...this drops the warnings, but it is not correct. What happen if we
have a board (as the zmx25) that does not want to print this info ?

get_reset_cause() is declared static in generic.c, and it is used only
by print_cpuinfo. Because we decided to not export get_reset_cause(). if
we do not want to use it we have to protect get_reset_cause() with
CONFIG_DISPLAY_CPUINFO inside soc.c instead of adding the CONFIG_ to the
board configuration file.

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/include/configs/zmx25.h b/include/configs/zmx25.h
index 374c88a..0c217b8 100644
--- a/include/configs/zmx25.h
+++ b/include/configs/zmx25.h
@@ -32,6 +32,8 @@ 
 #define CONFIG_SYS_HZ			1000
 #define CONFIG_SYS_TEXT_BASE		0xA0000000
 
+#define CONFIG_DISPLAY_CPUINFO
+
 /*
  * Environment settings
  */