Subject: kern/20585: GENERIC config COMPAT_1[56] option usage is (mostly) bogus
To: None <>
From: None <kre@munnari.OZ.AU>
List: netbsd-bugs
Date: 03/05/2003 17:09:06
>Number:         20585
>Category:       kern
>Synopsis:       GENERIC config COMPAT_1[56] option usage is (mostly) bogus
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 05 02:11:00 PST 2003
>Originator:     Robert Elz
>Release:        NetBSD 1.6P	(-current of 2003-03-03)
	Prince of Songkla University
System: NetBSD 1.6P NetBSD 1.6P (FUCHSIA) #35: Wed Mar 5 13:50:03 ICT 2003 root@:/usr/obj/sys/FUCHSIA i386
Architecture: i386
Machine: i386
	Many (but not all) sys/arch/*/conf/GENERIC* files include
		options	COMPAT_15
	None of the sys/arch/*/conf/GENERIC* files include
		options COMPAT_16

	Yet, COMPAT_15 is a (wholly) useless option - apart from the
	various sys/arch/*/conf/* files the only place it appears is
	in conf/files where it is defined.   Nothing in the kernel
	(in -current anyway) depends upon it in any way at all.

	On the other hand, COMPAT_16 does exist - currently twice.
	It is in arch/vax/vax/machdep.c (and is defined in
	arch/vax/conf/GENERIC so that one is fine).

	It is also in kern/subr_disk.c and so should be in all the
	various ports' conf/GENERIC files - the lack of it is almost
	certainly what causes so many people to bump into the
	"bad sysctl" from iostat (as hw.diskstats changed).

	But apart from those two, COMPAT_16 should also appear in
	vast numbers of arch/x/x/*machdep.c files - and in a way
	does, using the idiom
		#if 1 /* COMPAT_16 */
	which seems to date from the times when COMPAT_16 did not
	yet exist, and someone was hoping not to have to add it...


	Remove COMPAT_15 from everywhere except sys/conf/files
	where it wants to remain so it remains a valid (useless) option
	for people's private kernel config files.   While that isn't
	strictly necessary, it is a good idea to keep it there.
	It should be in none of the distributed config files though.

	Add COMPAT_16 to everywhere (GENERIC at least), except
	vax/conf/GENERIC where it exists already.   This is the
	most important part of this PR (the rest is just cleanup).

		#if 1 /* COMPAT_16 */
		#ifdef COMPAT_16
	throughout (appears in arch/x/x/*machdep.c files for most x)

	Document COMPAT_16 in options(4).   (Note there is no COMPAT_15
	there, so why everyone keeps using it is a mystery).

	Whie cleaning up, a few ports' GENERIC files could perhaps lose
	their COMPAT_09 compat_10 (etc) options, where they describe
	versions of the kernel that never existed for the port in
	question - and not just include them all "because everyone else