[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kernel/568: fdc.c doesn't compile when no fd is config'd




>Number:         568
>Category:       kernel
>Synopsis:       fdc.c doesn't compile when no fd is config'd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug  8 14:50:01 MDT 1998
>Last-Modified:
>Originator:     Andrew Lambeth
>Organization:
net
>Release:        2.3 (r1.9 fdc.c)
>Environment:
	System      : OpenBSD 2.3
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:
	If you accidently (why would you do this on purpose?) config a kernel 
	with fdc, but no fd, fdc.c doesn't build.  The only reason I submitted
	this is that the code already attempts to handle this situation with
	a conditional, but it doesn't work.
>How-To-Repeat:
	config a kernel with fdcX, and no fdX, then make 
>Fix:

Index: fdc.c
===================================================================
RCS file: /cvs/src/sys/dev/isa/fdc.c,v
retrieving revision 1.9
diff -u -r1.9 fdc.c
--- fdc.c       1996/11/30 09:34:42     1.9
+++ fdc.c       1998/08/08 20:12:04
@@ -371,14 +371,14 @@
 fdcintr(arg)
        void *arg;
 {
-       struct fdc_softc *fdc = arg;
-
 #if NFD > 0
+       struct fdc_softc *fdc = arg;
        extern int fdintr __P((struct fdc_softc *));
 
        /* Will switch on device type, shortly. */
        return (fdintr(fdc));
 #else
        printf("fdcintr: got interrupt, but no devices!\n");
+       return (1);
 #endif
 }

>Audit-Trail:
>Unformatted: