qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300Stat


From: Paul Brook
Subject: Re: [Qemu-devel] [PATCH 2/3] Clean up upcast from PCIDevice to I6300State
Date: Mon, 24 Aug 2009 12:59:06 +0100
User-agent: KMail/1.12.0 (Linux/2.6.30-1-amd64; KDE/4.3.0; x86_64; ; )

>  /* Device state. */
>  struct I6300State {
> -    PCIDevice dev;             /* PCI device state, must be first field. */
> +    PCIDevice dev;
>...
> -    I6300State *d = (I6300State *) dev;
> +    I6300State *d = container_of(dev, I6300State, dev);

I'm pretty sure this is wrong, and code elsewhere still requires the PCIDevice 
be the first field in I6300State. e.g. i6300esb_pc_init. Did you actually try 
putting dev at a nonzero offset?

Paul




reply via email to

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