From: "Daniel Rodrick" <daniel.rodrick@gmail.com>
To: kernelnewbies <kernelnewbies@nl.linux.org>, linux-newbie@vget.kernel.org
Subject: required header files not #included in cdev.h
Date: Wed, 31 Jan 2007 13:58:29 +0530 [thread overview]
Message-ID: <292693080701310028j3a4f246ducafbb3136421c0f5@mail.gmail.com> (raw)
Hi,
This referes to the file include/linux/cdev.h whose contents are listed below:
#ifndef _LINUX_CDEV_H
#define _LINUX_CDEV_H
#ifdef __KERNEL__
struct cdev {
struct kobject kobj;
struct module *owner;
const struct file_operations *ops;
struct list_head list;
dev_t dev;
unsigned int count;
};
void cdev_init(struct cdev *, const struct file_operations *);
struct cdev *cdev_alloc(void);
void cdev_put(struct cdev *p);
int cdev_add(struct cdev *, dev_t, unsigned);
void cdev_del(struct cdev *);
void cd_forget(struct inode *);
#endif
#endif
It is a little strange to me that it uses certain kernel structure
types like kobject, module, list_head etc without #including
appropriate headers. The result is that when I try to use struct cdev
in my module by simply #including cdev.h, it flags an error. As a
result I need to manually figure out which all headers do I need to
(additionally) #include and in what order.
Is this OK?
Dan
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/
next reply other threads:[~2007-01-31 8:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-31 8:28 Daniel Rodrick [this message]
2007-01-31 8:36 ` required header files not #included in cdev.h Robert P. J. Day
2007-01-31 9:26 ` Erik Mouw
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=292693080701310028j3a4f246ducafbb3136421c0f5@mail.gmail.com \
--to=daniel.rodrick@gmail.com \
--cc=kernelnewbies@nl.linux.org \
--cc=linux-newbie@vget.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox