On Mon, 2014-07-07 at 12:47 -0400, Tom Rini wrote:
> That's not how we like things to look however when we can help it.  Just
> toss a __maybe_unused in front of the declaration (and make sure we have
> <linux/compiler.h> included.

OK. How about the following?

Hans, BTW, I spotted this issue with:
        CROSS_COMPILE=arm-linux-gnueabihf- ./MAKEALL -s sunxi
which is a very useful invocation indeed!

8<-------------------

>From 5e0659b772380114a9e86624aefd1dcb09a90bd9 Mon Sep 17 00:00:00 2001
From: Ian Campbell <i...@hellion.org.uk>
Date: Sun, 6 Jul 2014 20:03:20 +0100
Subject: [PATCH] sunxi: Avoid unused variable warning.

Mark rc as __maybe_unused since it is infact unused on systems with neither
EMAC nor GMAC.

Signed-off-by: Ian Campbell <i...@hellion.org.uk>
---
 arch/arm/cpu/armv7/sunxi/board.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 1e506b5..538ffa7 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -24,6 +24,8 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/timer.h>
 
+#include <linux/compiler.h>
+
 #ifdef CONFIG_SPL_BUILD
 /* Pointer to the global data structure for SPL */
 DECLARE_GLOBAL_DATA_PTR;
@@ -115,7 +117,7 @@ void enable_caches(void)
  */
 int cpu_eth_init(bd_t *bis)
 {
-       int rc;
+       __maybe_unused int rc;
 
 #ifdef CONFIG_SUNXI_EMAC
        rc = sunxi_emac_initialize(bis);
-- 
1.9.0




_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to