[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 22/48] ivshmem: use common is_power_of_2()
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PULL 22/48] ivshmem: use common is_power_of_2() |
Date: |
Tue, 6 Oct 2015 21:19:18 +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 fbb6f40..e678b18 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] [PULL 15/48] ivshmem: initialize max_peer to -1, (continued)
- [Qemu-devel] [PULL 15/48] ivshmem: initialize max_peer to -1, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 18/48] ivshmem: improve error handling, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 25/48] ivshmem: check shm isn't already initialized, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 37/48] contrib: remove unnecessary strdup(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 47/48] ivshmem: use kvm irqfd for msi notifications, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 29/48] ivshmem: error on too many eventfd received, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 38/48] msix: implement pba write (but read-only), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 23/48] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 31/48] contrib: add ivshmem client and server, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 20/48] ivshmem: simplify a bit the code, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 22/48] ivshmem: use common is_power_of_2(),
marcandre . lureau <=
- [Qemu-devel] [PULL 42/48] ivshmem: do not keep shm_fd open, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 16/48] ivshmem: remove max_peer field, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 36/48] ivshmem: add check on protocol version in QEMU, marcandre . lureau, 2015/10/08
- Re: [Qemu-devel] [PULL 00/48] ivshmem series, Andreas Färber, 2015/10/08
- Re: [Qemu-devel] [PULL 00/48] ivshmem series, Marc-André Lureau, 2015/10/08
- Re: [Qemu-devel] [PULL 00/48] ivshmem series, Andreas Färber, 2015/10/08
- Re: [Qemu-devel] [PULL 00/48] ivshmem series, Marc-André Lureau, 2015/10/08
- [Qemu-devel] [PATCH 1/2] tests: Add ivshmem qtest, Andreas Färber, 2015/10/11
- Re: [Qemu-devel] [PATCH 1/2] tests: Add ivshmem qtest, Marc-André Lureau, 2015/10/10
- [Qemu-devel] [PATCH 2/2] ivshmem-test: Implement tests, Andreas Färber, 2015/10/11