Skip to contentSkip to conversation

cdev.h needs struct inode; add forward declaration

PATCH In review Josh Triplett 2 participants 2 messages Jan 29, 2007 – Jan 30, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cdev.h needs struct inode; add forward declaration

include/linux/cdev.h defines cd_forget to take a struct inode *, but does not pull in any definition or declaration for struct inode. This generates a compiler warning if a source file pulls in cdev.h without first pulling in fs.h. Add a forward declaration of struct inode to cdev.h, to eliminate the compiler warning and preserve the ability to include headers in any arbitrary order.

---
 include/linux/cdev.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
include/linux/cdev.h +2 -0
index f309b00..4281e80 100644
@@ -6,6 +6,8 @@
 #include <linux/kdev_t.h>
 #include <linux/list.h>
 
+struct inode;
+
 struct cdev {
 	struct kobject kobj;
 	struct module *owner;
#1 lore raw
Quoted 7 lines

include/linux/cdev.h defines cd_forget to take a struct inode *, but does not pull in any definition or declaration for struct inode. This generates a compiler warning if a source file pulls in cdev.h without first pulling in fs.h. Add a forward declaration of struct inode to cdev.h, to eliminate the compiler warning and preserve the ability to include headers in any arbitrary order.

We've been over this: http://lkml.org/lkml/2007/1/19/119
The patch went in into -mm and out again (why? - no reason was attached, Andrew.)

Jan

Signature · 1 line
ft: http://freshmeat.net/p/chaostables/