On Fri, 27 May 2011, Masao Uebayashi wrote: > On Fri, May 27, 2011 at 1:30 AM, David Laight <da...@l8s.co.uk> 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.)
The problem with this is that the two declarations are not tied together; it is still possible to have two differing variables, pretending to be the same, which is the problem that the common header solves. I think you should revert the change (as previously asked), and if you want to fix that issue re modules, you should do that separately (I suspect its a lot of work, but a lot of people will be thankful for it..) regards, iain