qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH 10/29] net/rocker: use QEMU_IS_ALIGNED macro


From: Eric Blake
Subject: Re: [Qemu-trivial] [PATCH 10/29] net/rocker: use QEMU_IS_ALIGNED macro
Date: Tue, 18 Jul 2017 12:51:55 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 07/18/2017 01:09 AM, Philippe Mathieu-Daudé wrote:
> Applied using the Coccinelle semantic patch scripts/coccinelle/use_osdep.cocci
> 
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
>  hw/net/rocker/rocker.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
> index 4f0f6d71e5..55228f2f52 100644
> --- a/hw/net/rocker/rocker.c
> +++ b/hw/net/rocker/rocker.c
> @@ -1419,7 +1419,7 @@ static int pci_rocker_init(PCIDevice *dev)
>              desc_ring_set_consume(ring, cmd_consume, ROCKER_MSIX_VEC_CMD);
>          } else if (i == ROCKER_RING_EVENT) {
>              desc_ring_set_consume(ring, NULL, ROCKER_MSIX_VEC_EVENT);
> -        } else if (i % 2 == 0) {
> +        } else if (QEMU_IS_ALIGNED(i, 2)) {
>              desc_ring_set_consume(ring, tx_consume,
>                                    ROCKER_MSIX_VEC_TX((i - 2) / 2));
>          } else if (i % 2 == 1) {
> 

Given the if chain, I think you don't want this one.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]