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: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH 2/3] hw/virtio-net.c: set config size using host features
Date: Thu, 7 Feb 2013 17:59:32 +0200

On Thu, Feb 07, 2013 at 04:22:45PM +0100, Stefan Hajnoczi wrote:
> 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.
> 
> Stefan

Yes but that's very confusing, you need to look at struct order
to see what's going on.

-- 
MST



reply via email to

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