From d0d3b8345b0d7c853b385d92e44553a1dbd26ea5 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 27 Mar 2000 20:24:02 +0000 Subject: [PATCH] Ahhrggg. Put the test for the compat shims AFTER the file that includes them. Pointed out by: bde --- sys/dev/amd/amd.c | 8 ++++---- sys/dev/ar/if_ar_pci.c | 8 ++++---- sys/dev/cy/cy_pci.c | 8 ++++---- sys/dev/en/if_en_pci.c | 8 ++++---- sys/dev/lnc/if_lnc_pci.c | 8 ++++---- sys/dev/sr/if_sr_pci.c | 8 ++++---- sys/pci/alpm.c | 8 ++++---- sys/pci/amd.c | 8 ++++---- sys/pci/cy_pci.c | 8 ++++---- sys/pci/if_ar_p.c | 8 ++++---- sys/pci/if_en_pci.c | 8 ++++---- sys/pci/if_lnc_p.c | 8 ++++---- sys/pci/if_mn.c | 8 ++++---- sys/pci/if_sr_p.c | 8 ++++---- sys/pci/meteor.c | 7 +++---- sys/pci/ncr.c | 8 ++++---- sys/pci/simos.c | 8 ++++---- 17 files changed, 67 insertions(+), 68 deletions(-) diff --git a/sys/dev/amd/amd.c b/sys/dev/amd/amd.c index 3d172f3d695b..073f6267a6d0 100644 --- a/sys/dev/amd/amd.c +++ b/sys/dev/amd/amd.c @@ -50,10 +50,6 @@ /* #define AMD_DEBUG0 */ /* #define AMD_DEBUG_SCSI_PHASE */ -#ifndef COMPAT_OLDPCI -#error "The amd device requires the old pci compatibility shims" -#endif - #include #include @@ -83,6 +79,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The amd device requires the old pci compatibility shims" +#endif + #define PCI_DEVICE_ID_AMD53C974 0x20201022ul #define PCI_BASE_ADDR0 0x10 diff --git a/sys/dev/ar/if_ar_pci.c b/sys/dev/ar/if_ar_pci.c index 9643412511cb..6fa1d522d3d7 100644 --- a/sys/dev/ar/if_ar_pci.c +++ b/sys/dev/ar/if_ar_pci.c @@ -29,10 +29,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The ar device requires the old pci compatibility shims" -#endif - #include "ar.h" #include @@ -42,6 +38,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The ar device requires the old pci compatibility shims" +#endif + /* * The must match with the real functions in if_ar.c */ diff --git a/sys/dev/cy/cy_pci.c b/sys/dev/cy/cy_pci.c index e52e554bc8b2..e1158d2e35e8 100644 --- a/sys/dev/cy/cy_pci.c +++ b/sys/dev/cy/cy_pci.c @@ -33,10 +33,6 @@ #include "opt_cy_pci_fastintr.h" -#ifndef COMPAT_OLDPCI -#error "The cy device requires the old pci compatibility shims" -#endif - #include #include #include @@ -51,6 +47,10 @@ #include #endif +#ifndef COMPAT_OLDPCI +#error "The cy device requires the old pci compatibility shims" +#endif + static const char *cy_probe __P((pcici_t, pcidi_t)); static void cy_attach __P((pcici_t, int)); diff --git a/sys/dev/en/if_en_pci.c b/sys/dev/en/if_en_pci.c index 5212499ce213..3a2f37a3fd95 100644 --- a/sys/dev/en/if_en_pci.c +++ b/sys/dev/en/if_en_pci.c @@ -45,10 +45,6 @@ * thanks to Matt Thomas for figuring out FreeBSD vs NetBSD vs etc.. diffs. */ -#ifndef COMPAT_OLDPCI -#error "The en device requires the old pci compatibility shims" -#endif - #include "en.h" #include @@ -70,6 +66,10 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The en device requires the old pci compatibility shims" +#endif + /* * prototypes diff --git a/sys/dev/lnc/if_lnc_pci.c b/sys/dev/lnc/if_lnc_pci.c index 19a2a07cc333..8d8745a74d20 100644 --- a/sys/dev/lnc/if_lnc_pci.c +++ b/sys/dev/lnc/if_lnc_pci.c @@ -20,10 +20,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The lnc device requires the old pci compatibility shims" -#endif - #include #include #include @@ -33,6 +29,10 @@ #include "lnc.h" +#ifndef COMPAT_OLDPCI +#error "The lnc device requires the old pci compatibility shims" +#endif + #define PCI_DEVICE_ID_PCNet_PCI 0x20001022 #define PCI_DEVICE_ID_PCHome_PCI 0x20011022 diff --git a/sys/dev/sr/if_sr_pci.c b/sys/dev/sr/if_sr_pci.c index 50ddb7fcb799..1bf8177ece7d 100644 --- a/sys/dev/sr/if_sr_pci.c +++ b/sys/dev/sr/if_sr_pci.c @@ -30,10 +30,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The sr device requires the old pci compatibility shims" -#endif - #include "sr.h" #include @@ -43,6 +39,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The sr device requires the old pci compatibility shims" +#endif + #ifndef BUGGY #define BUGGY 0 #endif diff --git a/sys/pci/alpm.c b/sys/pci/alpm.c index 7ed28d5d4118..1e8e785ba1fe 100644 --- a/sys/pci/alpm.c +++ b/sys/pci/alpm.c @@ -27,10 +27,6 @@ * */ -#ifndef COMPAT_OLDPCI -#error "The alpm device requires the old pci compatibility shims" -#endif - /* * Power Management support for the Acer M15x3 chipsets */ @@ -59,6 +55,10 @@ #include "alpm.h" +#ifndef COMPAT_OLDPCI +#error "The alpm device requires the old pci compatibility shims" +#endif + #define ALPM_DEBUG(x) if (alpm_debug) (x) #ifdef DEBUG diff --git a/sys/pci/amd.c b/sys/pci/amd.c index 3d172f3d695b..073f6267a6d0 100644 --- a/sys/pci/amd.c +++ b/sys/pci/amd.c @@ -50,10 +50,6 @@ /* #define AMD_DEBUG0 */ /* #define AMD_DEBUG_SCSI_PHASE */ -#ifndef COMPAT_OLDPCI -#error "The amd device requires the old pci compatibility shims" -#endif - #include #include @@ -83,6 +79,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The amd device requires the old pci compatibility shims" +#endif + #define PCI_DEVICE_ID_AMD53C974 0x20201022ul #define PCI_BASE_ADDR0 0x10 diff --git a/sys/pci/cy_pci.c b/sys/pci/cy_pci.c index e52e554bc8b2..e1158d2e35e8 100644 --- a/sys/pci/cy_pci.c +++ b/sys/pci/cy_pci.c @@ -33,10 +33,6 @@ #include "opt_cy_pci_fastintr.h" -#ifndef COMPAT_OLDPCI -#error "The cy device requires the old pci compatibility shims" -#endif - #include #include #include @@ -51,6 +47,10 @@ #include #endif +#ifndef COMPAT_OLDPCI +#error "The cy device requires the old pci compatibility shims" +#endif + static const char *cy_probe __P((pcici_t, pcidi_t)); static void cy_attach __P((pcici_t, int)); diff --git a/sys/pci/if_ar_p.c b/sys/pci/if_ar_p.c index 9643412511cb..6fa1d522d3d7 100644 --- a/sys/pci/if_ar_p.c +++ b/sys/pci/if_ar_p.c @@ -29,10 +29,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The ar device requires the old pci compatibility shims" -#endif - #include "ar.h" #include @@ -42,6 +38,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The ar device requires the old pci compatibility shims" +#endif + /* * The must match with the real functions in if_ar.c */ diff --git a/sys/pci/if_en_pci.c b/sys/pci/if_en_pci.c index 5212499ce213..3a2f37a3fd95 100644 --- a/sys/pci/if_en_pci.c +++ b/sys/pci/if_en_pci.c @@ -45,10 +45,6 @@ * thanks to Matt Thomas for figuring out FreeBSD vs NetBSD vs etc.. diffs. */ -#ifndef COMPAT_OLDPCI -#error "The en device requires the old pci compatibility shims" -#endif - #include "en.h" #include @@ -70,6 +66,10 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The en device requires the old pci compatibility shims" +#endif + /* * prototypes diff --git a/sys/pci/if_lnc_p.c b/sys/pci/if_lnc_p.c index 19a2a07cc333..8d8745a74d20 100644 --- a/sys/pci/if_lnc_p.c +++ b/sys/pci/if_lnc_p.c @@ -20,10 +20,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The lnc device requires the old pci compatibility shims" -#endif - #include #include #include @@ -33,6 +29,10 @@ #include "lnc.h" +#ifndef COMPAT_OLDPCI +#error "The lnc device requires the old pci compatibility shims" +#endif + #define PCI_DEVICE_ID_PCNet_PCI 0x20001022 #define PCI_DEVICE_ID_PCHome_PCI 0x20011022 diff --git a/sys/pci/if_mn.c b/sys/pci/if_mn.c index cc11fd5332c9..b4ec284b5659 100644 --- a/sys/pci/if_mn.c +++ b/sys/pci/if_mn.c @@ -24,10 +24,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The mn device requires the old pci compatibility shims" -#endif - /* * Stuff to describe the MUNIC32X and FALC54 chips. */ @@ -59,6 +55,10 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The mn device requires the old pci compatibility shims" +#endif + static int mn_maxlatency = 1000; SYSCTL_INT(_debug, OID_AUTO, mn_maxlatency, CTLFLAG_RW, &mn_maxlatency, 0, diff --git a/sys/pci/if_sr_p.c b/sys/pci/if_sr_p.c index 50ddb7fcb799..1bf8177ece7d 100644 --- a/sys/pci/if_sr_p.c +++ b/sys/pci/if_sr_p.c @@ -30,10 +30,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The sr device requires the old pci compatibility shims" -#endif - #include "sr.h" #include @@ -43,6 +39,10 @@ #include +#ifndef COMPAT_OLDPCI +#error "The sr device requires the old pci compatibility shims" +#endif + #ifndef BUGGY #define BUGGY 0 #endif diff --git a/sys/pci/meteor.c b/sys/pci/meteor.c index 68359eed3f45..b3cbc0b168ce 100644 --- a/sys/pci/meteor.c +++ b/sys/pci/meteor.c @@ -145,10 +145,6 @@ future version of this driver. */ -#ifndef COMPAT_OLDPCI -#error "The meteor device requires the old pci compatibility shims" -#endif - #include "meteor.h" #include "opt_meteor.h" @@ -175,6 +171,9 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The meteor device requires the old pci compatibility shims" +#endif static void meteor_intr __P((void *arg)); diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index a8f5ddb85fe4..6767d1f7abb7 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -39,10 +39,6 @@ *************************************************************************** */ -#ifndef COMPAT_OLDPCI -#error "The ncr device requires the old pci compatibility shims" -#endif - #define NCR_DATE "pl30 98/1/1" #define NCR_VERSION (2) @@ -205,6 +201,10 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The ncr device requires the old pci compatibility shims" +#endif + /*========================================================== ** ** Debugging tags diff --git a/sys/pci/simos.c b/sys/pci/simos.c index 1afb4322da99..e325f12f0501 100644 --- a/sys/pci/simos.c +++ b/sys/pci/simos.c @@ -26,10 +26,6 @@ * $FreeBSD$ */ -#ifndef COMPAT_OLDPCI -#error "The simos device requires the old pci compatibility shims" -#endif - #include #include #include @@ -56,6 +52,10 @@ #include #include +#ifndef COMPAT_OLDPCI +#error "The simos device requires the old pci compatibility shims" +#endif + #include struct simos_softc {