Subject: kern/1511: dev/scsi/ files fail to include
To: None <>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: netbsd-bugs
Date: 09/25/1995 17:17:02
>Number:         1511
>Category:       kern
>Synopsis:       sys/scsi/scsiconf.c etc. fail to include <sys/systm.h>
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 25 20:35:01 1995
>Originator:     Jonathan Stone
>Release:        NetBSD-current from 18 september 1995
System: NetBSD Reno.Stanford.EDU 1.0A NetBSD 1.0A (NEWCONF) #579: Mon Sep 25 13:42:43 PDT 1995 jonathan@Reno.Stanford.EDU:/usr/src/sys/arch/pmax/compile/NEWCONF pmax

	[[ I thought I'd send-pr'ed this already but I couldn't find it
	   with query-pr]]

	The NetBSD /sys/scsi drivers use min() without, in general, including
	<sys/systm.h>, which is where min() is declared. This breaks the
	scsi code on ports that don't (yet) have min in the kernel, and
	breaks prototype checking for  functions declared in lib/libkern/libkern.h
	(such as min()).   cgd says the canonical way to get these is
	via <sys/systm.h>.

	Configure a NetBSD/Pmax kernel with the NetBSD scsi drivers. The
	kernelwill fail to link, due to undefined references to min().
	Compiling with warnings about prototypes also fails, due to
	not including the relevant prototype declarations.

	1. Add #include <sys/systm.h> to the /sys/scsi/{cd,scsi_base,
	  scsi_ioctl}.c source files.  This cannot hurt.
	2. Add non-inline definitions for min(), etc. to the