[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 22/47] ivshmem: use common is_power_of_2()
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v4 22/47] ivshmem: use common is_power_of_2() |
Date: |
Thu, 24 Sep 2015 13:37:24 +0200 |
From: Marc-André Lureau <address@hidden>
The common version correctly checks for 0 value case.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Claudio Fontana <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 8ebc907..8207a98 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)
{
@@ -632,7 +628,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 v4 12/47] ivshmem: simplify around increase_dynamic_storage(), (continued)
- [Qemu-devel] [PATCH v4 12/47] ivshmem: simplify around increase_dynamic_storage(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 14/47] ivshmem: remove useless ivshmem_update_irq() val argument, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 13/47] ivshmem: allocate eventfds in resize_peers(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 16/47] ivshmem: remove max_peer field, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 15/47] ivshmem: initialize max_peer to -1, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 17/47] ivshmem: improve debug messages, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 18/47] ivshmem: improve error handling, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 19/47] ivshmem: print error on invalid peer id, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 20/47] ivshmem: simplify a bit the code, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 21/47] ivshmem: use common return, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 22/47] ivshmem: use common is_power_of_2(),
marcandre . lureau <=
- [Qemu-devel] [PATCH v4 23/47] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 24/47] ivshmem: shmfd can be 0, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 26/47] ivshmem: add device description, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 27/47] ivshmem: fix pci_ivshmem_exit(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 28/47] ivshmem: replace 'guest' for 'peer' appropriately, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 29/47] ivshmem: error on too many eventfd received, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 30/47] ivshmem: reset mask on device reset, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 32/47] ivshmem-client: check the number of vectors, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 33/47] ivshmem-server: use a uint16 for client ID, marcandre . lureau, 2015/09/24