Re: [RFC]confusions about 'struct' define

2012-06-04 Thread Sarbojit Ganguly
Foward declaration, that is. You can vaguely compare it to function prototypes. On 1 June 2012 15:00, Bernd Petrovitsch wrote: > Hi! > > On Don, 2012-05-31 at 01:37 +0800, harryxiyou wrote: >> On Thu, May 31, 2012 at 1:20 AM, Gaurav Jain wrote: > [...] >> > Those are forward declarations as the

Re: [RFC]confusions about 'struct' define

2012-06-01 Thread Bernd Petrovitsch
Hi! On Don, 2012-05-31 at 01:37 +0800, harryxiyou wrote: > On Thu, May 31, 2012 at 1:20 AM, Gaurav Jain wrote: [...] > > 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 standar

Re: [RFC]confusions about 'struct' define

2012-05-31 Thread michi1
Hi! On 00:50 Thu 31 May , harryxiyou wrote: ... > I have never seen struct define like > > "struct device; > struct device_private; > struct device_driver; > [...] > struct device_node; > struct iommu_ops;" This basically says that these structs exist and are defined somewhere. You need this

RE: [RFC]confusions about 'struct' define

2012-05-30 Thread Rajat Sharma
This might be the case of cyclic dependency where header files defining these structures are also including this .h file. -Rajat From: harryxiyou Sent: 30-05-2012 23:08 To: Gaurav Jain Cc: Greg-Kroah-Hartman; Harry Wei; kernelnewbies@kernelnewbies.org Subject: Re: [RFC]confusions about 's

Re: [RFC]confusions about 'struct' define

2012-05-30 Thread harryxiyou
On Thu, May 31, 2012 at 1:20 AM, Gaurav Jain wrote: Hi Gaurav, > 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. > Hmmm.., that is to say, they may be used before defini

Re: [RFC]confusions about 'struct' define

2012-05-30 Thread Gaurav Jain
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 wrote: > Hi guys, > > When I read the linux/device.h file for some device driver

[RFC]confusions about 'struct' define

2012-05-30 Thread harryxiyou
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; stru