From 3936caa00535d0b7543be5a4b315562111a6b3ab Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 12 Jan 2007 10:59:35 -0800 Subject: [PATCH] Refactor pciTagConvertRange2Host and pciConvertRange2Host. --- hw/xfree86/common/xf86pciBus.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 11e9bc008..00aad1508 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1025,9 +1025,17 @@ xf86CheckPciSlot(const struct pci_device *d) } -static void -pciTagConvertRange2Host(PCITAG tag, resRange *pRange) +void +pciConvertRange2Host(int entityIndex, resRange *pRange) { + struct pci_device *const pvp = xf86GetPciInfoForEntity(entityIndex); + const PCITAG tag = PCI_MAKE_TAG(PCI_MAKE_BUS(pvp->domain, pvp->bus), + pvp->dev, pvp->func); + + if (pvp == NULL) { + return; + } + if (!(pRange->type & ResBus)) return; @@ -1066,15 +1074,3 @@ pciTagConvertRange2Host(PCITAG tag, resRange *pRange) pRange->type &= ~(ResDomain | ResBus); pRange->type |= xf86GetPciDomain(tag) << 24; } - -void -pciConvertRange2Host(int entityIndex, resRange *pRange) -{ - const struct pci_device * const pvp = xf86GetPciInfoForEntity(entityIndex); - - if ( pvp != NULL ) { - const PCITAG tag = PCI_MAKE_TAG( PCI_MAKE_BUS( pvp->domain, pvp->bus ), - pvp->dev, pvp->func ); - pciTagConvertRange2Host(tag, pRange); - } -}