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

Re: [Xen-devel] [Qemu-devel] [PATCH] compiler: add a sizeof_field() macro



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 <stefanha@xxxxxxxxxx>
> 
> How'd you find all the existing instances?

This works:

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

> 
> Reviewed-by: John Snow <jsnow@xxxxxxxxxx>
> 
>> ---
>>  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(-)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.