Patchwork [U-Boot,v2,02/25] include/linux/compat.h: fix warning: preprocessor token {__iomem, __user} redefined

login
register
mail settings
Submitter Kim Phillips
Date Oct. 29, 2012, 11:34 p.m.
Message ID <1351553687-12469-3-git-send-email-kim.phillips@freescale.com>
Download mbox | patch
Permalink /patch/195163/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Kim Phillips - Oct. 29, 2012, 11:34 p.m.
include/linux/compat.h:4:9: warning: preprocessor token __user redefined
include/linux/compiler.h:7:10: this was the original definition
include/linux/compat.h:5:9: warning: preprocessor token __iomem redefined
include/linux/compiler.h:12:10: this was the original definition

fixup __iomem, __user definitions in compat.h code appears to be placed
there as a cover up from a code import from linux when u-boot didn't yet
have a compiler.h, introduced by commit
932394ac43e2e778e664eeb6e456fecd0fae6e59 "Rewrite of NAND code based on
what is in 2.6.12 Linux kernel".

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
v2: add a fix for breakeage introduced by above:

In file included from .../u-boot/u-boot/include/linux/mtd/mtd.h:12:0,
from mtdcore.c:10: .../u-boot/include/linux/mtd/mtd-abi.h:22:23:
error: expected ':', ',', ';', '}' or '__attribute__' before '*' token

on a number of omap3 boards (mtd-abi.h was using __user without
being defined).

 include/linux/compat.h      | 3 ---
 include/linux/mtd/mtd-abi.h | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

Patch

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 593b07f..e1338bf 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -1,9 +1,6 @@ 
 #ifndef _LINUX_COMPAT_H_
 #define _LINUX_COMPAT_H_
 
-#define __user
-#define __iomem
-
 #define ndelay(x)	udelay(1)
 
 #define printk	printf
diff --git a/include/linux/mtd/mtd-abi.h b/include/linux/mtd/mtd-abi.h
index 5991157..8bdd231 100644
--- a/include/linux/mtd/mtd-abi.h
+++ b/include/linux/mtd/mtd-abi.h
@@ -11,6 +11,8 @@ 
 #include <linux/compat.h>
 #endif
 
+#include <linux/compiler.h>
+
 struct erase_info_user {
 	uint32_t start;
 	uint32_t length;