From 28d363a7a2c6a13347bd35015181630e5707b4d6 Mon Sep 17 00:00:00 2001 From: jhb Date: Wed, 20 Aug 2008 17:50:59 +0000 Subject: Use switch statements instead of if-else for enabling PCI-express config space support. MFC after: 1 week --- sys/i386/pci/pci_cfgreg.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sys/i386/pci/pci_cfgreg.c') diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c index 6c78fd5..2fcc8d3 100644 --- a/sys/i386/pci/pci_cfgreg.c +++ b/sys/i386/pci/pci_cfgreg.c @@ -169,15 +169,21 @@ pci_cfgregopen(void) /* Check for supported chipsets */ vid = pci_cfgregread(0, 0, 0, PCIR_VENDOR, 2); did = pci_cfgregread(0, 0, 0, PCIR_DEVICE, 2); - if (vid == 0x8086) { - if (did == 0x3590 || did == 0x3592) { + switch (vid) { + case 0x8086: + switch (did) { + case 0x3590: + case 0x3592: /* Intel 7520 or 7320 */ pciebar = pci_cfgregread(0, 0, 0, 0xce, 2) << 16; pciereg_cfgopen(); - } else if (did == 0x2580 || did == 0x2584) { + break; + case 0x2580: + case 0x2584: /* Intel 915 or 925 */ pciebar = pci_cfgregread(0, 0, 0, 0x48, 4); pciereg_cfgopen(); + break; } } -- cgit v1.1