[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 21/39] ivshmem: use common is_power_of_2()
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 21/39] ivshmem: use common is_power_of_2() |
Date: |
Fri, 26 Jun 2015 16:49:27 +0200 |
The common version correctly checks for 0 value case.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/misc/ivshmem.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 8fcdd60..34da11a 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -117,10 +117,6 @@ static inline uint32_t ivshmem_has_feature(IVShmemState
*ivs,
return (ivs->features & (1 << feature));
}
-static inline bool is_power_of_two(uint64_t x) {
- return (x & (x - 1)) == 0;
-}
-
/* accessing registers - based on rtl8139 */
static void ivshmem_update_irq(IVShmemState *s)
{
@@ -631,7 +627,7 @@ static uint64_t ivshmem_get_size(IVShmemState * s, Error
**errp) {
}
/* BARs must be a power of 2 */
- if (!is_power_of_two(value)) {
+ if (!is_power_of_2(value)) {
error_setg(errp, "size must be power of 2");
return 0;
}
--
2.4.3
- [Qemu-devel] [PATCH 13/39] ivshmem: initialize max_peer to -1, (continued)
- [Qemu-devel] [PATCH 13/39] ivshmem: initialize max_peer to -1, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 12/39] ivshmem: remove useless ivshmem_update_irq() val argument, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 14/39] ivshmem: remove max_peer field, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 15/39] ivshmem: improve debug messages, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 16/39] ivshmem: improve error, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 17/39] ivshmem: print error on invalid peer id, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 18/39] ivshmem: add a warning if eventfd value is 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 19/39] ivshmem: beautify a bit the code, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 20/39] ivshmem: use common return, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 22/39] ivshmem: migrate with VMStateDescription, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 21/39] ivshmem: use common is_power_of_2(),
Marc-André Lureau <=
- [Qemu-devel] [PATCH 24/39] ivshmem: check shm isn't already initialized, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 23/39] ivshmem: shmfd can be 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 25/39] ivshmem: add device description, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 26/39] ivshmem: fix pci_ivshmem_exit(), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 28/39] ivshmem: error on too many eventfd received, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 27/39] ivshmem: replace 'guest' for 'peer' appropriately, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 29/39] ivshmem: reset mask on device reset, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 31/39] ivshmem-client: check the number of vectors, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 32/39] ivshmem-server: use a uint16 for client ID, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 33/39] ivshmem-server: include necessary headers, Marc-André Lureau, 2015/06/26