Root/target/linux/generic-2.6/patches-2.6.32/057-arm_fix_uncompress_code.patch

1From b53e9b5ebd5c6e718f54bcacd4e97b71533ca681 Mon Sep 17 00:00:00 2001
2From: Tony Lindgren <tony@atomide.com>
3Date: Thu, 14 Jan 2010 20:36:55 +0100
4Subject: [PATCH] ARM: 5882/1: ARM: Fix uncompress code compile for different defines of flush(void)
5
6Because of the include of the decompress_inflate.c file from
7boot/compress/misc.c, there are different flush() defines:
8
9In file included from arch/arm/boot/compressed/misc.c:249:
10arch/arm/boot/compressed/../../../../lib/decompress_inflate.c:138:29: error: macro "flush" passed 2 arguments, but takes just 0
11
12Fix this by removing the define of flush() in misc.c for
13CONFIG_DEBUG_ICEDCC as it's already defined in mach/uncompress.h,
14and that is being included unconditionally.
15
16Also use a static inline function instead of define
17for mach-mxc and mach-gemini to avoid similar bug
18for those platforms.
19
20Signed-off-by: Tony Lindgren <tony@atomide.com>
21Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
22---
23 arch/arm/boot/compressed/misc.c | 1 -
24 arch/arm/mach-gemini/include/mach/uncompress.h | 4 +++-
25 arch/arm/plat-mxc/include/mach/uncompress.h | 4 +++-
26 3 files changed, 6 insertions(+), 3 deletions(-)
27
28--- a/arch/arm/boot/compressed/misc.c
29+++ b/arch/arm/boot/compressed/misc.c
30@@ -88,7 +88,6 @@ static void icedcc_putc(int ch)
31 #endif
32 
33 #define putc(ch) icedcc_putc(ch)
34-#define flush() do { } while (0)
35 #endif
36 
37 static void putstr(const char *ptr)
38--- a/arch/arm/mach-gemini/include/mach/uncompress.h
39+++ b/arch/arm/mach-gemini/include/mach/uncompress.h
40@@ -30,7 +30,9 @@ static inline void putc(char c)
41     UART[UART_TX] = c;
42 }
43 
44-#define flush() do { } while (0)
45+static inline void flush(void)
46+{
47+}
48 
49 /*
50  * nothing to do
51--- a/arch/arm/plat-mxc/include/mach/uncompress.h
52+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
53@@ -60,7 +60,9 @@ static void putc(int ch)
54     UART(TXR) = ch;
55 }
56 
57-#define flush() do { } while (0)
58+static inline void flush(void)
59+{
60+}
61 
62 #define MX1_UART1_BASE_ADDR 0x00206000
63 #define MX25_UART1_BASE_ADDR 0x43f90000
64

Archive Download this file



interactive