Skip to contentSkip to conversation

pull in linux/types.h in linux/nbd.h

PATCH In review Mike Frysinger 2 participants 4 messages Oct 9, 2006 – Oct 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pull in linux/types.h in linux/nbd.h

the nbd header uses __be32 and such types but doesnt actually include the header that defines these things (linux/types.h); so lets include it -mike

the nbd header uses __be32 and such types but doesnt actually include the header that defines these things (linux/types.h); so lets include it

include/linux/nbd.h +2 -0
index e712e7d..d6b6dc0 100644
@@ -15,6 +15,8 @@
 #ifndef LINUX_NBD_H
 #define LINUX_NBD_H
 
+#include <linux/types.h>
+
 #define NBD_SET_SOCK	_IO( 0xab, 0 )
 #define NBD_SET_BLKSIZE	_IO( 0xab, 1 )
 #define NBD_SET_SIZE	_IO( 0xab, 2 )
#1 lore raw
Quoted 4 lines

the nbd header uses __be32 and such types but doesnt actually include the header that defines these things (linux/types.h); so lets include it -mike

Hm, <linux/cdev.h> uses struct kobject and should therefore include <linux/kobejct.h>, can you make a patch for that too? Thanks.

	-`J'
#2 lore raw
Quoted 5 lines · Jan Engelhardt
Quoted 2 lines

the nbd header uses __be32 and such types but doesnt actually include the header that defines these things (linux/types.h); so lets include it

Hm, <linux/cdev.h> uses struct kobject and should therefore include <linux/kobejct.h>, can you make a patch for that too? Thanks.

linux/cdev.h isnt exported to userspace so i dont really care about it ... if you do, feel free to write the patch yourself. Thanks.
-mike

#3 lore raw

PATCH 1/1 pull in necessary header files for cdev.h

linux/cdev.h uses struct kobject and other structs and should therefore include them. Currently, a module either needs to add the missing includes itself, or, in case a module includes other headers already, needs to put <linux/cdev.h> last, which goes against a alphabetically-sorted include list.

include/linux/cdev.h +4 -0
Index: linux-2.6.19-rc2/include/linux/cdev.h
===================================================================
@@ -2,6 +2,10 @@
 #define _LINUX_CDEV_H
 #ifdef __KERNEL__
 
+#include <linux/kobject.h>
+#include <linux/kdev_t.h>
+#include <linux/list.h>
+
 struct cdev {
 	struct kobject kobj;
 	struct module *owner;

#<EOF>

	-`J'