[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [qemu-s390x] [Qemu-devel] [PATCH] compiler: add a sizeof_field() mac
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [qemu-s390x] [Qemu-devel] [PATCH] compiler: add a sizeof_field() macro |
Date: |
Thu, 14 Jun 2018 17:33:04 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 06/14/2018 04:17 PM, John Snow wrote:
> On 06/14/2018 12:44 PM, Stefan Hajnoczi wrote:
>> Determining the size of a field is useful when you don't have a struct
>> variable handy. Open-coding this is ugly.
>>
>> This patch adds the sizeof_field() macro, which is similar to
>> typeof_field(). Existing instances are updated to use the macro.
>>
>> Signed-off-by: Stefan Hajnoczi <address@hidden>
>
> How'd you find all the existing instances?
This works:
$ git grep -E 'sizeof.*)0)->'
>
> Reviewed-by: John Snow <address@hidden>
>
>> ---
>> include/hw/xen/io/ring.h | 2 +-
>> include/qemu/compiler.h | 2 ++
>> accel/tcg/translate-all.c | 2 +-
>> hw/display/xenfb.c | 4 ++--
>> hw/net/rocker/rocker_of_dpa.c | 2 +-
>> hw/net/virtio-net.c | 2 +-
>> target/i386/kvm.c | 2 +-
>> target/ppc/arch_dump.c | 10 +++++-----
>> target/s390x/arch_dump.c | 20 ++++++++++----------
>> 9 files changed, 24 insertions(+), 22 deletions(-)