[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH 09/29] net: use QEMU_IS_ALIGNED macro
From: |
Eric Blake |
Subject: |
Re: [Qemu-trivial] [PATCH 09/29] net: use QEMU_IS_ALIGNED macro |
Date: |
Tue, 18 Jul 2017 12:51:30 -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>
> ---
> net/eth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/eth.c b/net/eth.c
> index 5b9ba26a56..187a6812f6 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -332,7 +332,7 @@ eth_setup_ip4_fragmentation(const void *l2hdr, size_t
> l2hdr_len,
> uint16_t frag_off_units = frag_offset / IP_FRAG_UNIT_SIZE;
> uint16_t new_ip_off;
>
> - assert(frag_offset % IP_FRAG_UNIT_SIZE == 0);
> + assert(QEMU_IS_ALIGNED(frag_offset, IP_FRAG_UNIT_SIZE));
> assert((frag_off_units & ~IP_OFFMASK) == 0);
This line is also a candidate for using the macro, albeit in the form
QEMU_IS_ALIGNED(frag_off_units, IP_OFFMASK + 1), which might not make as
much sense (but it DOES re-visit my question of whether the coccinelle
script should be taught more patterns)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-trivial] [PATCH 05/29] block: use QEMU_IS_ALIGNED macro, (continued)
- [Qemu-trivial] [PATCH 06/29] migration/block: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 07/29] ds1338: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 08/29] ui: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 09/29] net: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- Re: [Qemu-trivial] [PATCH 09/29] net: use QEMU_IS_ALIGNED macro,
Eric Blake <=
- [Qemu-trivial] [PATCH 10/29] net/rocker: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 11/29] s390x/sclp: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 12/29] sm501: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 13/29] tcg: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 14/29] cris: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18
- [Qemu-trivial] [PATCH 16/29] lm32: use QEMU_IS_ALIGNED macro, Philippe Mathieu-Daudé, 2017/07/18