qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features
Date: Thu, 07 Feb 2013 09:55:12 -0600
User-agent: Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu)

Stefan Hajnoczi <address@hidden> writes:

> On Thu, Feb 7, 2013 at 3:43 PM, Laszlo Ersek <address@hidden> wrote:
>> Instead, what about
>>
>> #define endof(container, field) \
>>     (offsetof(container, field) + sizeof ((container *)0)->field)
>
> As mentioned in my reply, I think endof() isn't necessary.
>
> Just use offsetof() the *next* field or sizeof() the entire struct
> (for the last field).  That way you let someone else do the dirty
> pointer tricks.

You don't always have a next field so it would get syntactically
awkward.

Regards,

Anthony Liguori

>
> Stefan




reply via email to

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