Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci remove macros which just hide cfdata internals



details:   https://anonhg.NetBSD.org/src/rev/4c47fc014fe4
branches:  trunk
changeset: 569908:4c47fc014fe4
user:      drochner <drochner%NetBSD.org@localhost>
date:      Mon Sep 13 12:22:52 2004 +0000

description:
remove macros which just hide cfdata internals
(and are used at one place only)

diffstat:

 sys/dev/pci/pci.c    |  16 ++++++++--------
 sys/dev/pci/pcivar.h |  17 +----------------
 2 files changed, 9 insertions(+), 24 deletions(-)

diffs (76 lines):

diff -r f251671aa182 -r 4c47fc014fe4 sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Mon Sep 13 10:52:34 2004 +0000
+++ b/sys/dev/pci/pci.c Mon Sep 13 12:22:52 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.88 2004/08/30 15:05:20 drochner Exp $        */
+/*     $NetBSD: pci.c,v 1.89 2004/09/13 12:22:52 drochner Exp $        */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.88 2004/08/30 15:05:20 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.89 2004/09/13 12:22:52 drochner Exp $");
 
 #include "opt_pci.h"
 
@@ -112,8 +112,8 @@
        struct pcibus_attach_args *pba = aux;
 
        /* Check the locators */
-       if (cf->pcibuscf_bus != PCIBUS_UNK_BUS &&
-           cf->pcibuscf_bus != pba->pba_bus)
+       if (cf->cf_loc[PCIBUSCF_BUS] != PCIBUSCF_BUS_DEFAULT &&
+           cf->cf_loc[PCIBUSCF_BUS] != pba->pba_bus)
                return (0);
 
        /* sanity */
@@ -263,11 +263,11 @@
            const locdesc_t *ldesc, void *aux)
 {
 
-       if (cf->pcicf_dev != PCI_UNK_DEV &&
-           cf->pcicf_dev != ldesc->locs[PCICF_DEV])
+       if (cf->cf_loc[PCICF_DEV] != PCICF_DEV_DEFAULT &&
+           cf->cf_loc[PCICF_DEV] != ldesc->locs[PCICF_DEV])
                return (0);
-       if (cf->pcicf_function != PCI_UNK_FUNCTION &&
-           cf->pcicf_function != ldesc->locs[PCICF_FUNCTION])
+       if (cf->cf_loc[PCICF_FUNCTION] != PCICF_FUNCTION_DEFAULT &&
+           cf->cf_loc[PCICF_FUNCTION] != ldesc->locs[PCICF_FUNCTION])
                return (0);
        return (config_match(parent, cf, aux));
 }
diff -r f251671aa182 -r 4c47fc014fe4 sys/dev/pci/pcivar.h
--- a/sys/dev/pci/pcivar.h      Mon Sep 13 10:52:34 2004 +0000
+++ b/sys/dev/pci/pcivar.h      Mon Sep 13 12:22:52 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcivar.h,v 1.66 2004/08/30 15:05:20 drochner Exp $     */
+/*     $NetBSD: pcivar.h,v 1.67 2004/09/13 12:22:53 drochner Exp $     */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -173,21 +173,6 @@
 
 extern struct cfdriver pci_cd;
 
-/*
- * Locators devices that attach to 'pcibus', as specified to config.
- */
-#define        pcibuscf_bus            cf_loc[PCIBUSCF_BUS]
-#define        PCIBUS_UNK_BUS          PCIBUSCF_BUS_DEFAULT    /* wildcarded 'bus' */
-
-/*
- * Locators for PCI devices, as specified to config.
- */
-#define        pcicf_dev               cf_loc[PCICF_DEV]
-#define        PCI_UNK_DEV             PCICF_DEV_DEFAULT       /* wildcarded 'dev' */
-
-#define        pcicf_function          cf_loc[PCICF_FUNCTION]
-#define        PCI_UNK_FUNCTION        PCICF_FUNCTION_DEFAULT /* wildcarded 'function' */
-
 int pcibusprint(void *, const char *);
 
 /*



Home | Main Index | Thread Index | Old Index