Skip to contentSkip to conversation

kernel.h Move preprocessor #warning about using kernel headers in userpsace to types.h

PATCH Superseded Justin P. Mattock 1 participant 1 message Jul 1, 2010

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kernel.h Move preprocessor #warning about using kernel headers in userpsace to types.h

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.

---
 include/linux/kernel.h |    6 ------
 include/linux/types.h  |    7 ++++++-
 2 files changed, 6 insertions(+), 7 deletions(-)
include/linux/kernel.h +0 -6
index 8317ec4..bd8501a 100644
@@ -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 */
include/linux/types.h +6 -1
index 23d237a..1be69b8 100644
@@ -8,7 +8,12 @@
 
 #define DECLARE_BITMAP(name,bits) \
 	unsigned long name[BITS_TO_LONGS(bits)]
-
+#else
+#ifndef __EXPORTED_HEADERS__
+#ifndef __KERNEL__
+#warning "Attempt to use kernel headers from user space, see http://kernelnewbies.org/KernelHeaders"
+#endif /* __KERNEL__ */
+#endif /* __EXPORTED_HEADERS__ */
 #endif
 
 #include <linux/posix_types.h>
Signature · 1 line
1.6.5.2.180.gc5b3e