2.3.13 scsi.c fails to compile as module (patch supplied)

Richard Sharman (rsharman@pobox.com)
Sat, 14 Aug 1999 01:13:23 -0400 (EDT)


Summary: in 2.3.13, scsi.c fails to compile as a module

Symptoms:
gcc -D__KERNEL__ -I/usr/src/linux-2.3/include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -DCPU=586 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.3/include/linux/modversions.h -c -o scsi.o scsi.c
scsi.c:423: parse error before string constant
scsi.c:423: warning: function declaration isn't a prototype
scsi.c:423: warning: data definition has no type or storage class
scsi.c:445: parse error before string constant
scsi.c:445: warning: function declaration isn't a prototype
scsi.c:445: warning: data definition has no type or storage class
scsi.c: In function `scsi_dump_status':
scsi.c:3385: warning: format argument is not a pointer (arg 2)
scsi.c: At top level:
scsi.c:410: warning: `scsi_logging_setup' defined but not used
scsi.c:432: warning: `scsi_luns_setup' defined but not used
make[2]: *** [scsi.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.3/drivers/scsi'
make[1]: *** [_modsubdir_scsi] Error 2
make[1]: Leaving directory `/usr/src/linux-2.3/drivers'
make: *** [_mod_drivers] Error 2

Cause:
Compiling with -E shows:
__setup("scsi_logging=", scsi_logging_setup);
i.e. __setup has not been recognized as a macro.

Fix: (I think!)
My understanding of this __init stuff in init.h is that it is hints
for files built in and is to be ignored in modules. Most of the
macros have dummy definitions if MODULE is defined.

I made this change and scsi.c now compiles:

bash-2.01$ diff -c init.h.orig init.h
*** init.h.orig Thu Aug 12 23:26:30 1999
--- init.h Sat Aug 14 00:51:27 1999
***************
*** 108,113 ****
--- 108,114 ----
#define __exitdata
#define __initfunc(__arginit) __arginit
#define __initcall
+ #define __setup(str, fn)
/* For assembly routines */
#define __INIT
#define __FINIT
bash-2.01$

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/