diff --git a/cutils.c b/cutils.c index 2d65357ee4..9617e083c6 100644 --- a/cutils.c +++ b/cutils.c @@ -97,7 +97,7 @@ time_t mktimegm(struct tm *tm) return t; } -int fls(int i) +int qemu_fls(int i) { return 32 - clz32(i); } diff --git a/hw/virtio.c b/hw/virtio.c index 24a4b26718..dba80f81c0 100644 --- a/hw/virtio.c +++ b/hw/virtio.c @@ -858,7 +858,7 @@ VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name, size = 20 + config_size; if (size & (size-1)) - size = 1 << fls(size); + size = 1 << qemu_fls(size); pci_register_io_region(pci_dev, 0, size, PCI_ADDRESS_SPACE_IO, virtio_map); diff --git a/qemu-common.h b/qemu-common.h index cb5d46541e..d3df63ea01 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -104,7 +104,7 @@ char *pstrcat(char *buf, int buf_size, const char *s); int strstart(const char *str, const char *val, const char **ptr); int stristart(const char *str, const char *val, const char **ptr); time_t mktimegm(struct tm *tm); -int fls(int i); +int qemu_fls(int i); #define qemu_isalnum(c) isalnum((unsigned char)(c)) #define qemu_isalpha(c) isalpha((unsigned char)(c))