From: gjainroorkee@gmail.com (Gaurav Jain)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [RFC]confusions about 'struct' define
Date: Wed, 30 May 2012 22:50:25 +0530 [thread overview]
Message-ID: <CAAFF8wR4QNBPEJ3xmia1Fz66A6sZGx8emAD14HMecrHJf+Q12w@mail.gmail.com> (raw)
In-Reply-To: <CAD+1EGNbNqZSnO54NDRO083NEmGUXoetmwLE67cGh0Y55mkRVg@mail.gmail.com>
Those are forward declarations as they are being used in defining struct
bus_attribute. It's nothing special about GNU-C. That's the case for ANSI-C
too. Pretty standard.
On Wed, May 30, 2012 at 10:20 PM, harryxiyou <harryxiyou@gmail.com> wrote:
> Hi guys,
>
> When I read the linux/device.h file for some device driver usage, i find
> some
> confusions like following.
>
> $ head -60 device.h
> [...]
>
> struct device;
> struct device_private;
> struct device_driver;
> struct driver_private;
> struct module;
> struct class;
> struct subsys_private;
> struct bus_type;
> struct device_node;
> struct iommu_ops;
>
> struct bus_attribute {
> struct attribute attr;
> ssize_t (*show)(struct bus_type *bus, char *buf);
> ssize_t (*store)(struct bus_type *bus, const char *buf, size_t
> count);
> };
> [...]
>
> I have never seen struct define like
>
> "struct device;
> struct device_private;
> struct device_driver;
> [...]
> struct device_node;
> struct iommu_ops;"
>
> The common define is like this
>
> "struct a{
> int a;
> int b;
> [...]
> }"
>
> Is this just struct declaration or some extension about gcc? Cloud
> anyone give me
> some explanations?
> Thanks in advance ;-)
>
> Note: my kernel version is 3.0 around.
>
> --
> Thanks
> Harry Wei
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Gaurav Jain
Associate Software Engineer
VxVM Escalations Team, SAMG
Symantec Software India Pvt. Ltd.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120530/144cb394/attachment.html
next prev parent reply other threads:[~2012-05-30 17:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-30 16:50 [RFC]confusions about 'struct' define harryxiyou
2012-05-30 17:20 ` Gaurav Jain [this message]
2012-05-30 17:37 ` harryxiyou
2012-06-01 9:30 ` Bernd Petrovitsch
2012-06-04 14:18 ` Sarbojit Ganguly
2012-05-31 16:40 ` michi1 at michaelblizek.twilightparadox.com
-- strict thread matches above, loose matches on Subject: below --
2012-05-30 18:41 Rajat Sharma
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=CAAFF8wR4QNBPEJ3xmia1Fz66A6sZGx8emAD14HMecrHJf+Q12w@mail.gmail.com \
--to=gjainroorkee@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).