[PATCH v3]kernel.h Move preprocessor #warning about using kernel headers in userpsace to types.h

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Justin P. Mattock
Date: Thursday, July 1, 2010 - 2:28 pm

Move the preprocessor #warning message:
warning: #warning Attempt to use kernel headers from user space, 
see http://kernelnewbies.org/KernelHeaders
from kernel.h to types.h.
And also fixe the #warning message due to the preprocessor not being
able to read the web address due to it thinking it was the start of a comment.
also remove the extra #ifndef _KERNEL_ since it's already there.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>

---
 include/linux/kernel.h |    6 ------
 include/linux/types.h  |    5 ++++-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 8317ec4..bd8501a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -728,12 +728,6 @@ extern int do_sysinfo(struct sysinfo *info);
 
 #endif /* __KERNEL__ */
 
-#ifndef __EXPORTED_HEADERS__
-#ifndef __KERNEL__
-#warning Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders
-#endif /* __KERNEL__ */
-#endif /* __EXPORTED_HEADERS__ */
-
 #define SI_LOAD_SHIFT	16
 struct sysinfo {
 	long uptime;			/* Seconds since boot */
diff --git a/include/linux/types.h b/include/linux/types.h
index 23d237a..331d8ba 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -8,7 +8,10 @@
 
 #define DECLARE_BITMAP(name,bits) \
 	unsigned long name[BITS_TO_LONGS(bits)]
-
+#else
+#ifndef __EXPORTED_HEADERS__
+#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
+#endif /* __EXPORTED_HEADERS__ */
 #endif
 
 #include <linux/posix_types.h>
-- 
1.6.5.2.180.gc5b3e

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH v3]kernel.h Move preprocessor #warning about using ..., Justin P. Mattock, (Thu Jul 1, 2:28 pm)
Re: [PATCH v3]kernel.h Move preprocessor #warning about us ..., Justin P. Mattock, (Sun Jul 11, 1:07 pm)