Compiling SCSI without /proc [FIX]

Paul Gortmaker (gpg109@rsphy6.anu.edu.au)
Thu, 30 May 1996 05:30:17 +1000 (EST)


A while ago someone was moaning because they couldn't compile SCSI
without /proc support. The fix is pretty trivial and is confined to
scsi.c (which already has #if CONFIG_PROC_FS here and there, but not in
all the right places). A tiny Makefile tweak ensures that scsi_proc.c
doesn't even get compiled if /proc is disabled, which make sense...

FWIW, typical networking support builds & works fine w/o proc already.

Paul.

diff -ur /usr/src/linux/drivers/scsi/ChangeLog linux/drivers/scsi/ChangeLog
--- /usr/src/linux/drivers/scsi/ChangeLog Fri May 17 17:50:58 1996
+++ linux/drivers/scsi/ChangeLog Thu May 30 04:53:51 1996
@@ -1,3 +1,7 @@
+Thu May 30 00:00:00 1996 Paul Gortmaker <gpg109@rsphy1.anu.edu.au>
+
+ Fix things so SCSI compiles without /proc once again.
+
Fri May 17 00:00:00 1996 Leonard N. Zubkoff <lnz@dandelion.com>

* BusLogic Driver Version 2.0.3 Released.
diff -ur /usr/src/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile
--- /usr/src/linux/drivers/scsi/Makefile Sat May 18 18:58:33 1996
+++ linux/drivers/scsi/Makefile Thu May 30 04:36:14 1996
@@ -35,7 +35,10 @@
endif

ifeq ($(CONFIG_SCSI),y)
-L_OBJS += hosts.o scsi.o scsi_ioctl.o constants.o scsicam.o scsi_proc.o
+L_OBJS += hosts.o scsi.o scsi_ioctl.o constants.o scsicam.o
+ ifeq ($(CONFIG_PROC_FS),y)
+ L_OBJS += scsi_proc.o
+ endif
LX_OBJS += scsi_syms.o
else
ifeq ($(CONFIG_SCSI),m)
diff -ur /usr/src/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- /usr/src/linux/drivers/scsi/scsi.c Tue May 14 16:21:38 1996
+++ linux/drivers/scsi/scsi.c Thu May 30 04:45:11 1996
@@ -149,6 +149,7 @@
/* This is the pointer to the /proc/scsi code.
* It is only initialized to !=0 if the scsi code is present
*/
+#if CONFIG_PROC_FS
extern int (* dispatch_scsi_info_ptr)(int ino, char *buffer, char **start,
off_t offset, int length, int inout);
extern int dispatch_scsi_info(int ino, char *buffer, char **start,
@@ -161,6 +162,7 @@
NULL, NULL,
NULL, NULL, NULL
};
+#endif

/*
* As the scsi do command functions are intelligent, and may need to
@@ -2492,7 +2494,9 @@
#endif

/* Yes we're here... */
+#if CONFIG_PROC_FS
dispatch_scsi_info_ptr = dispatch_scsi_info;
+#endif

/* Init a few things so we can "malloc" memory. */
scsi_loadable_module_flag = 0;
@@ -3380,7 +3384,9 @@
/*
* This makes /proc/scsi visible.
*/
+#if CONFIG_PROC_FS
dispatch_scsi_info_ptr = dispatch_scsi_info;
+#endif

timer_table[SCSI_TIMER].fn = scsi_main_timeout;
timer_table[SCSI_TIMER].expires = 0;
@@ -3417,10 +3423,10 @@
{
#if CONFIG_PROC_FS
proc_scsi_unregister(0, PROC_SCSI_SCSI);
-#endif

/* No, we're not here anymore. Don't show the /proc/scsi files. */
dispatch_scsi_info_ptr = 0L;
+#endif

/*
* Free up the DMA pool.