[PATCH 1/1] Simplify, statement is always true.

Maya Rashish coypu at sdf.org
Thu Sep 22 00:08:40 UTC 2016


pVideo->bus is uint8_t, always less than 256.

Signed-off-by: Maya Rashish <coypu at sdf.org>
---
 hw/xfree86/common/xf86pciBus.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 8158c2b..bed4434 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1457,11 +1457,7 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo,
 
     pVideo = (struct pci_device *) busData;
 
-    if (pVideo->bus < 256)
-        snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
-    else
-        snprintf(busnum, sizeof(busnum), "%d@%d",
-                 pVideo->bus & 0x00ff, pVideo->bus >> 8);
+    snprintf(busnum, sizeof(busnum), "%d", pVideo->bus);
 
     XNFasprintf(&tmp, "PCI:%s:%d:%d",
                 busnum, pVideo->dev, pVideo->func);
-- 
2.9.0



More information about the xorg-devel mailing list