Skip to contentSkip to conversation

don't export videodev.h internal structure to userland

PATCH New GOTO Masanori 1 participant 1 message Nov 4, 2003 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't export videodev.h internal structure to userland

Hi,

This patch fixes not to compile with linux/videodev.h:

	> cat v.c
	#include <linux/videodev.h>
	int main() {}
	> gcc v.c
	In file included from /usr/include/linux/device.h:17,
	                 from /usr/include/linux/videodev.h:6,
	                 from /tmp/v.c:1:
	/usr/include/linux/list.h:576:2: warning: #warning "don't include kernel headers in 
	userspace"
	In file included from /usr/include/linux/device.h:18,
	                 from /usr/include/linux/videodev.h:6,
	                 from /tmp/v.c:1:
	/usr/include/linux/spinlock.h: In function `bit_spin_lock':
	/usr/include/linux/spinlock.h:413: error: invalid type argument of `->'
	...

This problem is occured by including device.h outside of __KERNEL__, so I move the place of this header inclusion. This and previous patch is for kernel 2.6.0-test9.

Please apply it.

Regards,
-- gotom

linux/videodev.h +1 -1
@@ -3,13 +3,13 @@
 
 #include <linux/types.h>
 #include <linux/version.h>
-#include <linux/device.h>
 
 #define HAVE_V4L2 1
 #include <linux/videodev2.h>
 
 #ifdef __KERNEL__
 
+#include <linux/device.h>
 #include <linux/poll.h>
 #include <linux/mm.h>
 

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/