Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Don't use class or typename as a variable name.



details:   https://anonhg.NetBSD.org/src/rev/38863b79f8f7
branches:  trunk
changeset: 332016:38863b79f8f7
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Sep 05 05:29:16 2014 +0000

description:
Don't use class or typename as a variable name.

diffstat:

 sys/dev/pci/pci.c      |  10 +++++-----
 sys/dev/pci/pci_subr.c |  44 ++++++++++++++++++++++----------------------
 sys/dev/pci/pciconf.c  |  22 +++++++++++-----------
 3 files changed, 38 insertions(+), 38 deletions(-)

diffs (254 lines):

diff -r 7e72a43ea4fe -r 38863b79f8f7 sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Fri Sep 05 05:27:23 2014 +0000
+++ b/sys/dev/pci/pci.c Fri Sep 05 05:29:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.144 2013/09/15 09:19:52 martin Exp $ */
+/*     $NetBSD: pci.c,v 1.145 2014/09/05 05:29:16 matt Exp $   */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.144 2013/09/15 09:19:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci.c,v 1.145 2014/09/05 05:29:16 matt Exp $");
 
 #include "opt_pci.h"
 
@@ -274,7 +274,7 @@
 {
        pci_chipset_tag_t pc = sc->sc_pc;
        struct pci_attach_args pa;
-       pcireg_t id, /* csr, */ class, intr, bhlcr, bar, endbar;
+       pcireg_t id, /* csr, */ pciclass, intr, bhlcr, bar, endbar;
        int ret, pin, bus, device, function, i, width;
        int locs[PCICF_NLOCS];
 
@@ -290,7 +290,7 @@
 
        id = pci_conf_read(pc, tag, PCI_ID_REG);
        /* csr = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); */
-       class = pci_conf_read(pc, tag, PCI_CLASS_REG);
+       pciclass = pci_conf_read(pc, tag, PCI_CLASS_REG);
 
        /* Invalid vendor ID value? */
        if (PCI_VENDOR(id) == PCI_VENDOR_INVALID)
@@ -364,7 +364,7 @@
        pa.pa_function = function;
        pa.pa_tag = tag;
        pa.pa_id = id;
-       pa.pa_class = class;
+       pa.pa_class = pciclass;
 
        /*
         * Set up memory, I/O enable, and PCI command flags
diff -r 7e72a43ea4fe -r 38863b79f8f7 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c    Fri Sep 05 05:27:23 2014 +0000
+++ b/sys/dev/pci/pci_subr.c    Fri Sep 05 05:29:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_subr.c,v 1.124 2014/06/09 11:08:05 msaitoh Exp $   */
+/*     $NetBSD: pci_subr.c,v 1.125 2014/09/05 05:29:16 matt Exp $      */
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.124 2014/06/09 11:08:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.125 2014/09/05 05:29:16 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -603,7 +603,7 @@
 {
        pci_vendor_id_t vendor;
        pci_product_id_t product;
-       pci_class_t class;
+       pci_class_t pciclass;
        pci_subclass_t subclass;
        pci_interface_t interface;
        pci_revision_t revision;
@@ -617,7 +617,7 @@
        vendor = PCI_VENDOR(id_reg);
        product = PCI_PRODUCT(id_reg);
 
-       class = PCI_CLASS(class_reg);
+       pciclass = PCI_CLASS(class_reg);
        subclass = PCI_SUBCLASS(class_reg);
        interface = PCI_INTERFACE(class_reg);
        revision = PCI_REVISION(class_reg);
@@ -627,7 +627,7 @@
 
        classp = pci_class;
        while (classp->name != NULL) {
-               if (class == classp->val)
+               if (pciclass == classp->val)
                        break;
                classp++;
        }
@@ -660,7 +660,7 @@
                cp += snprintf(cp, ep - cp, " (");
                if (classp->name == NULL)
                        cp += snprintf(cp, ep - cp,
-                           "class 0x%02x, subclass 0x%02x", class, subclass);
+                           "class 0x%02x, subclass 0x%02x", pciclass, subclass);
                else {
                        if (subclassp == NULL || subclassp->name == NULL)
                                cp += snprintf(cp, ep - cp,
@@ -2375,13 +2375,13 @@
 {
        pcireg_t regs[o2i(256)];
        int off, capoff, endoff, hdrtype;
-       const char *typename;
+       const char *type_name;
 #ifdef _KERNEL
-       void (*typeprintfn)(pci_chipset_tag_t, pcitag_t, const pcireg_t *,
+       void (*type_printfn)(pci_chipset_tag_t, pcitag_t, const pcireg_t *,
            int);
        int sizebars;
 #else
-       void (*typeprintfn)(const pcireg_t *);
+       void (*type_printfn)(const pcireg_t *);
 #endif
 
        printf("PCI configuration registers:\n");
@@ -2420,43 +2420,43 @@
        switch (hdrtype) {              /* XXX make a table, eventually */
        case 0:
                /* Standard device header */
-               typename = "\"normal\" device";
-               typeprintfn = &pci_conf_print_type0;
+               type_name = "\"normal\" device";
+               type_printfn = &pci_conf_print_type0;
                capoff = PCI_CAPLISTPTR_REG;
                endoff = 64;
                break;
        case 1:
                /* PCI-PCI bridge header */
-               typename = "PCI-PCI bridge";
-               typeprintfn = &pci_conf_print_type1;
+               type_name = "PCI-PCI bridge";
+               type_printfn = &pci_conf_print_type1;
                capoff = PCI_CAPLISTPTR_REG;
                endoff = 64;
                break;
        case 2:
                /* PCI-CardBus bridge header */
-               typename = "PCI-CardBus bridge";
-               typeprintfn = &pci_conf_print_type2;
+               type_name = "PCI-CardBus bridge";
+               type_printfn = &pci_conf_print_type2;
                capoff = PCI_CARDBUS_CAPLISTPTR_REG;
                endoff = 72;
                break;
        default:
-               typename = NULL;
-               typeprintfn = 0;
+               type_name = NULL;
+               type_printfn = 0;
                capoff = -1;
                endoff = 64;
                break;
        }
        printf("  Type %d ", hdrtype);
-       if (typename != NULL)
-               printf("(%s) ", typename);
+       if (type_name != NULL)
+               printf("(%s) ", type_name);
        printf("header:\n");
        pci_conf_print_regs(regs, 16, endoff);
        printf("\n");
-       if (typeprintfn) {
+       if (type_printfn) {
 #ifdef _KERNEL
-               (*typeprintfn)(pc, tag, regs, sizebars);
+               (*type_printfn)(pc, tag, regs, sizebars);
 #else
-               (*typeprintfn)(regs);
+               (*type_printfn)(regs);
 #endif
        } else
                printf("    Don't know how to pretty-print type %d header.\n",
diff -r 7e72a43ea4fe -r 38863b79f8f7 sys/dev/pci/pciconf.c
--- a/sys/dev/pci/pciconf.c     Fri Sep 05 05:27:23 2014 +0000
+++ b/sys/dev/pci/pciconf.c     Fri Sep 05 05:29:16 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pciconf.c,v 1.36 2012/10/20 06:09:07 matt Exp $        */
+/*     $NetBSD: pciconf.c,v 1.37 2014/09/05 05:29:16 matt Exp $        */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.36 2012/10/20 06:09:07 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciconf.c,v 1.37 2014/09/05 05:29:16 matt Exp $");
 
 #include "opt_pci.h"
 
@@ -439,7 +439,7 @@
 {
        pciconf_dev_t   *pd;
        pciconf_win_t   *pi, *pm;
-       pcireg_t        class, cmd, icr, bhlc, bar, mask, bar64, mask64, busreg;
+       pcireg_t        classreg, cmd, icr, bhlc, bar, mask, bar64, mask64, busreg;
        u_int64_t       size;
        int             br, width, reg_start, reg_end;
 
@@ -449,12 +449,12 @@
        pd->ppb = NULL;
        pd->enable = mode;
 
-       class = pci_conf_read(pb->pc, tag, PCI_CLASS_REG);
+       classreg = pci_conf_read(pb->pc, tag, PCI_CLASS_REG);
 
        cmd = pci_conf_read(pb->pc, tag, PCI_COMMAND_STATUS_REG);
        bhlc = pci_conf_read(pb->pc, tag, PCI_BHLC_REG);
 
-       if (PCI_CLASS(class) != PCI_CLASS_BRIDGE
+       if (PCI_CLASS(classreg) != PCI_CLASS_BRIDGE
            && PCI_HDRTYPE_TYPE(bhlc) != PCI_HDRTYPE_PPB) {
                cmd &= ~(PCI_COMMAND_MASTER_ENABLE |
                    PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE);
@@ -525,8 +525,8 @@
        for (br = reg_start; br < reg_end; br += width) {
 #if 0
 /* XXX Should only ignore if IDE not in legacy mode? */
-               if (PCI_CLASS(class) == PCI_CLASS_MASS_STORAGE &&
-                   PCI_SUBCLASS(class) == PCI_SUBCLASS_MASS_STORAGE_IDE) {
+               if (PCI_CLASS(classreg) == PCI_CLASS_MASS_STORAGE &&
+                   PCI_SUBCLASS(classreg) == PCI_SUBCLASS_MASS_STORAGE_IDE) {
                        break;
                }
 #endif
@@ -1022,14 +1022,14 @@
         * Configure the latency for the devices, and enable them.
         */
        for (pd=pb->device ; pd < &pb->device[pb->ndevs] ; pd++) {
-               pcireg_t cmd, class, misc;
+               pcireg_t cmd, classreg, misc;
                int     ltim;
 
                if (pci_conf_debug) {
                        print_tag(pd->pc, pd->tag);
                        printf("Configuring device.\n");
                }
-               class = pci_conf_read(pd->pc, pd->tag, PCI_CLASS_REG);
+               classreg = pci_conf_read(pd->pc, pd->tag, PCI_CLASS_REG);
                misc = pci_conf_read(pd->pc, pd->tag, PCI_BHLC_REG);
                cmd = pci_conf_read(pd->pc, pd->tag, PCI_COMMAND_STATUS_REG);
                if (pd->enable & PCI_CONF_ENABLE_PARITY)
@@ -1038,8 +1038,8 @@
                        cmd |= PCI_COMMAND_SERR_ENABLE;
                if (pb->fast_b2b)
                        cmd |= PCI_COMMAND_BACKTOBACK_ENABLE;
-               if (PCI_CLASS(class) != PCI_CLASS_BRIDGE ||
-                   PCI_SUBCLASS(class) != PCI_SUBCLASS_BRIDGE_PCI) {
+               if (PCI_CLASS(classreg) != PCI_CLASS_BRIDGE ||
+                   PCI_SUBCLASS(classreg) != PCI_SUBCLASS_BRIDGE_PCI) {
                        if (pd->enable & PCI_CONF_ENABLE_IO)
                                cmd |= PCI_COMMAND_IO_ENABLE;
                        if (pd->enable & PCI_CONF_ENABLE_MEM)



Home | Main Index | Thread Index | Old Index