[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2()
From: |
Claudio Fontana |
Subject: |
Re: [Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2() |
Date: |
Wed, 16 Sep 2015 13:31:32 +0200 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 |
On 15.09.2015 18:07, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
>
> 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 e391396..f40bc98 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)
> {
> @@ -630,7 +626,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;
> }
>
Reviewed-by: Claudio Fontana <address@hidden>
- [Qemu-devel] [PATCH v3 16/46] ivshmem: remove max_peer field, (continued)
- [Qemu-devel] [PATCH v3 16/46] ivshmem: remove max_peer field, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 18/46] ivshmem: improve error, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 17/46] ivshmem: improve debug messages, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 20/46] ivshmem: simplify a bit the code, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 19/46] ivshmem: print error on invalid peer id, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 21/46] ivshmem: use common return, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2(), marcandre . lureau, 2015/09/15
- Re: [Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2(),
Claudio Fontana <=
- [Qemu-devel] [PATCH v3 23/46] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 25/46] ivshmem: check shm isn't already initialized, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 24/46] ivshmem: shmfd can be 0, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 27/46] ivshmem: fix pci_ivshmem_exit(), marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 26/46] ivshmem: add device description, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 28/46] ivshmem: replace 'guest' for 'peer' appropriately, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 29/46] ivshmem: error on too many eventfd received, marcandre . lureau, 2015/09/15