From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIhy-0002aO-EB for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UmIhx-0003Us-DL for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:09:34 -0400 Received: from ns232118.ovh.net ([178.33.234.66]:34099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UmIhx-0003Uf-7w for qemu-devel@nongnu.org; Tue, 11 Jun 2013 03:09:33 -0400 Message-ID: <51B6CD29.5040608@greensocs.com> Date: Tue, 11 Jun 2013 09:09:29 +0200 From: Frederic Konrad MIME-Version: 1.0 References: <2015a3db86888f2c28f4023ccf196a02c2196762.1370931825.git.peter.crosthwaite@xilinx.com> In-Reply-To: <2015a3db86888f2c28f4023ccf196a02c2196762.1370931825.git.peter.crosthwaite@xilinx.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFT PATCH v1 12/30] virtio/virtio-pci: QOM casting sweep List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.crosthwaite@xilinx.com Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, afaerber@suse.de Hi, On 11/06/2013 08:49, peter.crosthwaite@xilinx.com wrote: > From: Peter Crosthwaite > > Use standard QOM cast macro. Remove usages of container_of() and > direct -> style upcasting. > > Signed-off-by: Peter Crosthwaite [...] > static inline VirtIOPCIProxy *to_virtio_pci_proxy(DeviceState *d) > { > - return container_of(d, VirtIOPCIProxy, pci_dev.qdev); > + return VIRTIO_PCI(d); > } Maybe you can replace each to_virtio_pci_proxy directly with VIRTIO_PCI? > > /* DeviceState to VirtIOPCIProxy. Note: used on datapath, > @@ -106,7 +106,7 @@ static inline VirtIOPCIProxy *to_virtio_pci_proxy(DeviceState *d) > */ > static inline VirtIOPCIProxy *to_virtio_pci_proxy_fast(DeviceState *d) > { > - return container_of(d, VirtIOPCIProxy, pci_dev.qdev); > + return VIRTIO_PCI(d); > } > > static void virtio_pci_notify(DeviceState *d, uint16_t vector)