[PATCH 6/7] Remove xf86FormatPciBusNumber from API, inline the one place its used

Alan Coopersmith alan.coopersmith at oracle.com
Tue Nov 1 15:42:21 PDT 2011


Found no calls from current driver modules

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 hw/xfree86/common/xf86.h       |    1 -
 hw/xfree86/common/xf86pciBus.c |   17 ++++++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 3185baf..f216d5e 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -104,7 +104,6 @@ extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
                                             int *device, int *func);
 extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
                                               int device, int func);
-extern _X_EXPORT void xf86FormatPciBusNumber(int busnum, char *buffer);
 extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device * pPci);
 extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device * pPci,
                                           memType base);
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index fad0ae6..c009aba 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -81,16 +81,6 @@ static struct pci_slot_match xf86IsolateDevice = {
     PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, 0
 };
 
-void
-xf86FormatPciBusNumber(int busnum, char *buffer)
-{
-    /* 'buffer' should be at least 8 characters long */
-    if (busnum < 256)
-	sprintf(buffer, "%d", busnum);
-    else
-	sprintf(buffer, "%d@%d", busnum & 0x00ff, busnum >> 8);
-}
-
 /*
  * xf86Bus.c interface
  */
@@ -1345,7 +1335,12 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
 
     pVideo = (struct pci_device *) busData;
 
-    xf86FormatPciBusNumber(pVideo->bus, busnum);
+    if (pVideo->bus < 256)
+	snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
+    else
+	snprintf(busnum, sizeof(busnum), "%d@%d",
+		 pVideo->bus & 0x00ff, pVideo->bus >> 8);
+
     XNFasprintf(&GDev->busID, "PCI:%s:%d:%d",
 		busnum, pVideo->dev, pVideo->func);
 
-- 
1.7.3.2



More information about the xorg-devel mailing list