public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] lib/display_options: fix compiler warnings
Date: Mon, 15 Jun 2015 14:21:01 +0200	[thread overview]
Message-ID: <1434370862-8203-4-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1434370862-8203-1-git-send-email-hs@denx.de>

fix compiler warnings if compiled for SPL without
serial port support (CONFIG_SPL_SERIAL_SUPPORT is
not set).

Signed-off-by: Heiko Schocher <hs@denx.de>
---

 lib/display_options.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/lib/display_options.c b/lib/display_options.c
index 6d9c6aa..17814c7 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -25,7 +25,10 @@ int display_options (void)
 
 void print_freq(uint64_t freq, const char *s)
 {
-	unsigned long m = 0, n;
+	unsigned long m = 0;
+#if defined(CONFIG_SPL_SERIAL_SUPPORT)
+	unsigned long n;
+#endif
 	uint32_t f;
 	static const char names[] = {'G', 'M', 'K'};
 	unsigned long d = 1e9;
@@ -45,7 +48,9 @@ void print_freq(uint64_t freq, const char *s)
 	}
 
 	f = do_div(freq, d);
+#if defined(CONFIG_SPL_SERIAL_SUPPORT)
 	n = freq;
+#endif
 
 	/* If there's a remainder, show the first few digits */
 	if (f) {
@@ -58,7 +63,9 @@ void print_freq(uint64_t freq, const char *s)
 			m = (m / 10) + (m % 100 >= 50);
 	}
 
+#if defined(CONFIG_SPL_SERIAL_SUPPORT)
 	printf("%lu", n);
+#endif
 	if (m)
 		printf(".%ld", m);
 	printf(" %cHz%s", c, s);
@@ -121,7 +128,7 @@ int print_buffer(ulong addr, const void *data, uint width, uint count,
 	} lb;
 	int i;
 #ifdef CONFIG_SYS_SUPPORT_64BIT_DATA
-	uint64_t __maybe_unsued x;
+	uint64_t x;
 #else
 	uint32_t __maybe_unused x;
 #endif
-- 
2.1.0

  parent reply	other threads:[~2015-06-15 12:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 12:20 [U-Boot] [PATCH 0/4] add support for the at91 based smartweb board Heiko Schocher
2015-06-15 12:20 ` [U-Boot] [PATCH 1/4] spl, common, serial: build SPL without serial support Heiko Schocher
2015-06-15 15:32   ` Tom Rini
2015-06-16  5:21     ` Heiko Schocher
2015-06-15 12:21 ` [U-Boot] [PATCH 2/4] nand, atmel: remove udelay in spl_nand_erase_one() Heiko Schocher
2015-06-15 23:41   ` Scott Wood
2015-06-15 12:21 ` Heiko Schocher [this message]
2015-06-15 14:43   ` [U-Boot] [PATCH 3/4] lib/display_options: fix compiler warnings Tom Rini
2015-06-16  4:44     ` Heiko Schocher
2015-06-15 12:21 ` [U-Boot] [PATCH 4/4] arm, at91: support for sam9260 based smwartweb board Heiko Schocher

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=1434370862-8203-4-git-send-email-hs@denx.de \
    --to=hs@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