[PATCH] buglet in drivers/scsi/scsi.c

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Thu Jul 20 2000 - 14:28:42 EST


Compiling 2.4.0-test4 with
        # CONFIG_MODULES is not set
        CONFIG_BLK_DEV_IDESCSI=y
        CONFIG_SCSI=y
results in:

scsi.c: In function `scsi_register_host':
scsi.c:1956: warning: implicit declaration of function `scsi_unregister_host'
scsi.c: At top level:
scsi.c:2085: warning: `scsi_unregister_host' was declared implicitly `extern' and later `static'
scsi.c:2068: warning: previous declaration of `scsi_unregister_host'
scsi.c:2085: warning: type mismatch with previous implicit declaration
scsi.c:2068: warning: previous implicit declaration of `scsi_unregister_host'
scsi.c:2085: warning: `scsi_unregister_host' was previously implicitly declared to return `int'

The problem is that scsi.c has a forward declaration of scsi_register_host
and scsi_unregister_host inside an #if/#endif, but the condition used in
the forward declaration isn't the same as that in the actual definition,
which leads to the type mismatches seen above.

Trivial patch below (against 2.4.0-test4) fixes this. Please apply.

/Mikael

--- linux-2.4.0-test4/drivers/scsi/scsi.c.~1~ Tue Jul 11 19:35:12 2000
+++ linux-2.4.0-test4/drivers/scsi/scsi.c Thu Jul 20 19:11:16 2000
@@ -1361,7 +1361,7 @@
         SCpnt->done(SCpnt);
 }
 
-#ifdef CONFIG_MODULES
+#if defined(CONFIG_MODULES) || defined(CONFIG_BLK_DEV_IDESCSI) || defined(CONFIG_USB_STORAGE)
 static int scsi_register_host(Scsi_Host_Template *);
 static void scsi_unregister_host(Scsi_Host_Template *);
 #endif

-
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/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:14 EST