public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] zmx25: Fix build warning due to 'get_reset_cause' defined but not used
Date: Fri, 23 Sep 2011 17:25:39 +0200	[thread overview]
Message-ID: <4E7CA4F3.1000304@denx.de> (raw)
In-Reply-To: <1316790802-26344-1-git-send-email-fabio.estevam@freescale.com>

On 09/23/2011 05:13 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
> 
> Fix this warning by defining get_reset_cause only if CONFIG_DISPLAY_CPUINFO is defined.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v2:
> - Move the location of get_reset_cause
> Changes since v1:
> - Only define get_reset_cause when CONFIG_DISPLAY_CPUINFO is defined.
>  arch/arm/cpu/arm926ejs/mx25/generic.c |   46 ++++++++++++++++----------------
>  1 files changed, 23 insertions(+), 23 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c b/arch/arm/cpu/arm926ejs/mx25/generic.c
> index 1261640..8e60a26 100644
> --- a/arch/arm/cpu/arm926ejs/mx25/generic.c
> +++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
> @@ -105,29 +105,6 @@ ulong imx_get_perclk (int clk)
>  	return lldiv (fref, div);
>  }
>  
> -static char *get_reset_cause(void)
> -{
> -	/* read RCSR register from CCM module */
> -	struct ccm_regs *ccm =
> -		(struct ccm_regs *)IMX_CCM_BASE;
> -
> -	u32 cause = readl(&ccm->rcsr) & 0x0f;
> -
> -	if (cause == 0)
> -		return "POR";
> -	else if (cause == 1)
> -		return "RST";
> -	else if ((cause & 2) == 2)
> -		return "WDOG";
> -	else if ((cause & 4) == 4)
> -		return "SW RESET";
> -	else if ((cause & 8) == 8)
> -		return "JTAG";
> -	else
> -		return "unknown reset";
> -
> -}
> -
>  u32 get_cpu_rev(void)
>  {
>  	u32 srev;
> @@ -153,6 +130,29 @@ u32 get_cpu_rev(void)
>  }
>  
>  #if defined(CONFIG_DISPLAY_CPUINFO)
> +static char *get_reset_cause(void)
> +{
> +	/* read RCSR register from CCM module */
> +	struct ccm_regs *ccm =
> +		(struct ccm_regs *)IMX_CCM_BASE;
> +
> +	u32 cause = readl(&ccm->rcsr) & 0x0f;
> +
> +	if (cause == 0)
> +		return "POR";
> +	else if (cause == 1)
> +		return "RST";
> +	else if ((cause & 2) == 2)
> +		return "WDOG";
> +	else if ((cause & 4) == 4)
> +		return "SW RESET";
> +	else if ((cause & 8) == 8)
> +		return "JTAG";
> +	else
> +		return "unknown reset";
> +
> +}
> +
>  int print_cpuinfo (void)
>  {
>  	char buf[32];

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

      reply	other threads:[~2011-09-23 15:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 15:13 [U-Boot] [PATCH v3] zmx25: Fix build warning due to 'get_reset_cause' defined but not used Fabio Estevam
2011-09-23 15:25 ` Stefano Babic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E7CA4F3.1000304@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox