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 <[email protected]> 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 > [email protected] > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > -- Gaurav Jain Associate Software Engineer VxVM Escalations Team, SAMG Symantec Software India Pvt. Ltd.
_______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
