]> git.proxmox.com Git - mirror_qemu.git/blobdiff - hw/pci/slotid_cap.c
Convert (ffs(val) - 1) to ctz32(val)
[mirror_qemu.git] / hw / pci / slotid_cap.c
index 62f7bae2f12b6f026769581357e27d8bcc472914..1c01d346c927a87ad09849583472412182d010dc 100644 (file)
@@ -3,7 +3,7 @@
 #include "qemu/error-report.h"
 
 #define SLOTID_CAP_LENGTH 4
-#define SLOTID_NSLOTS_SHIFT (ffs(PCI_SID_ESR_NSLOTS) - 1)
+#define SLOTID_NSLOTS_SHIFT ctz32(PCI_SID_ESR_NSLOTS)
 
 int slotid_cap_init(PCIDevice *d, int nslots,
                     uint8_t chassis,