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 <stefa...@redhat.com>
> 
> How'd you find all the existing instances?

This works:

$ git grep -E 'sizeof.*)0)->'

> 
> Reviewed-by: John Snow <js...@redhat.com>
> 
>> ---
>>  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(-)

Reply via email to