tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev



[ moved from source-changes-d@ ]

hi,

> On Fri, May 27, 2011 at 1:30 AM, David Laight <david%l8s.co.uk@localhost> 
> wrote:
>> On Thu, May 26, 2011 at 07:12:57AM +0000, David Holland wrote:
>>> On Wed, May 25, 2011 at 04:33:38PM +0000, Masao Uebayashi wrote:
>>>  > Modified Files:
>>>  >    src/sys/dev/bluetooth: bcsp.c bthub.c btuart.c
>>>  >    src/sys/dev/ieee1394: fwdev.c fwmem.c fwohci.c
>>>  >
>>>  > Log Message:
>>>  > Declare cfdrivers using extern rather than including ioconf.h.
>>>
>>> This is wrong. Please revert it.
>>>
>>> The purpose of declaring things in header files is to make sure all
>>> uses are consistent.
>>
>> Is there another header file that could contain:
>>    #define CFDRIVER(prefix) extern struct cfdriver prefix##_cd
> 
> sys/device.h has CFDRIVER_DECL, which defines (not declares) a
> cfdriver struct.  So something like
> 
> #ifndef _MODULE
> #define CFDRIVER_DECL(x) extern struct cfdriver __CONCAT(x,_cd)
> #else
> #define CFDRIVER_DECL(x) \
> struct cfdriver __CONCAT(x,_cd) = { ... }
> #endif
> 
> would work.  (Already working here.)

can't it be non-conditional?
eg. make a driver always provide the structure.

(note that i'm autoconf-ignorant. :-)

YAMAMOTO Takashi

> 
>>
>> Then the bcsp.h could contain:
>>    CFDRIVER(bcsp);
>> which gives (effectively) the same guarantee as including ioconf.h.
>>
>> I think something like that would help building drivers as kernel modules.
>>
>>        David
>>
>> --
>> David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index