2.1.23 compile error: floppy.o as module

wojtowij (wojtowij@erols.com)
Tue, 28 Jan 1997 02:18:14 -0500 (EST)


Just a note to whoever is maintaining the floppy driver:

when compiling it as a module, the macro MODULE_PARM(floppy, s) gets
expanded twice giving you two definitions of const char __module_parm_floppy.
This of course causes a compiler error:

make[2]: Entering directory `/boot/linux-2.1/drivers/block'
gcc -D__KERNEL__ -I/boot/linux-2.1/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -DMODVERSIONS -include /boot/linux-2.0/include/linux/modversions.h -c -o floppy.o floppy.c
floppy.c:4224: redefinition of `__module_parm_floppy'
floppy.c:4131: `__module_parm_floppy' previously defined here
make[2]: *** [floppy.o] Error 1

I just put an #ifndef MODULE around the second instance as the first instance
was in a #ifdef MODULE. Just out of curiousity, are these MODULE_PARM const
array setups needed when a driver is not compiled as a module?

later,
John