Module Name:    src
Committed By:   matt
Date:           Fri Sep  5 05:29:16 UTC 2014

Modified Files:
        src/sys/dev/pci: pci.c pci_subr.c pciconf.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/pci/pci.c
cvs rdiff -u -r1.124 -r1.125 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/pci/pciconf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pci.c
diff -u src/sys/dev/pci/pci.c:1.144 src/sys/dev/pci/pci.c:1.145
--- src/sys/dev/pci/pci.c:1.144	Sun Sep 15 09:19:52 2013
+++ src/sys/dev/pci/pci.c	Fri Sep  5 05:29:16 2014
@@ -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_probe_device(struct pci_softc *sc, p
 {
 	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 @@ pci_probe_device(struct pci_softc *sc, p
 
 	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 @@ pci_probe_device(struct pci_softc *sc, p
 	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

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.124 src/sys/dev/pci/pci_subr.c:1.125
--- src/sys/dev/pci/pci_subr.c:1.124	Mon Jun  9 11:08:05 2014
+++ src/sys/dev/pci/pci_subr.c	Fri Sep  5 05:29:16 2014
@@ -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_devinfo(pcireg_t id_reg, pcireg_t cl
 {
 	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 @@ pci_devinfo(pcireg_t id_reg, pcireg_t cl
 	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 @@ pci_devinfo(pcireg_t id_reg, pcireg_t cl
 
 	classp = pci_class;
 	while (classp->name != NULL) {
-		if (class == classp->val)
+		if (pciclass == classp->val)
 			break;
 		classp++;
 	}
@@ -660,7 +660,7 @@ pci_devinfo(pcireg_t id_reg, pcireg_t cl
 		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 @@ pci_conf_print(
 {
 	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 @@ pci_conf_print(
 	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",

Index: src/sys/dev/pci/pciconf.c
diff -u src/sys/dev/pci/pciconf.c:1.36 src/sys/dev/pci/pciconf.c:1.37
--- src/sys/dev/pci/pciconf.c:1.36	Sat Oct 20 06:09:07 2012
+++ src/sys/dev/pci/pciconf.c	Fri Sep  5 05:29:16 2014
@@ -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 @@ pci_do_device_query(pciconf_bus_t *pb, p
 {
 	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 @@ pci_do_device_query(pciconf_bus_t *pb, p
 	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 @@ pci_do_device_query(pciconf_bus_t *pb, p
 	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_bus(pciconf_bus_t *pb)
 	 * 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 @@ configure_bus(pciconf_bus_t *pb)
 			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)

Reply via email to