From 96f7c01c8c88ab09204b311bf34772cbf18318b9 Mon Sep 17 00:00:00 2001 From: avg Date: Thu, 24 Sep 2009 07:11:23 +0000 Subject: number of cleanups in i386 and amd64 pci md code o introduce PCIE_REGMAX and use it instead of ad-hoc constant o where 'reg' parameter/variable is not already unsigned, cast it to unsigned before comparison with maximum value to cut off negative values o use PCI_SLOTMAX in several places where 31 or 32 were explicitly used o drop redundant check of 'bytes' in i386 pciereg_cfgread() - valid values are already checked in the subsequent switch Reviewed by: jhb MFC after: 1 week --- sys/dev/pci/pcireg.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/dev/pci/pcireg.h') diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index c7a7245..981d1e0 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -44,6 +44,7 @@ #define PCI_SLOTMAX 31 /* highest supported slot number */ #define PCI_FUNCMAX 7 /* highest supported function number */ #define PCI_REGMAX 255 /* highest supported config register addr. */ +#define PCIE_REGMAX 4095 /* highest supported config register addr. */ #define PCI_MAXHDRTYPE 2 /* PCI config header registers for all devices */ -- cgit v1.1