From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWM6o-0002m3-Lp for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:46:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWM6l-0002zR-FC for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:46:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWM6l-0002zM-AU for qemu-devel@nongnu.org; Thu, 18 Feb 2016 05:46:51 -0500 Date: Thu, 18 Feb 2016 12:46:45 +0200 From: "Michael S. Tsirkin" Message-ID: <20160218124154-mutt-send-email-mst@redhat.com> References: <1455790054-1952-1-git-send-email-leonid.bloch@ravellosystems.com> <1455790054-1952-6-git-send-email-leonid.bloch@ravellosystems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1455790054-1952-6-git-send-email-leonid.bloch@ravellosystems.com> Subject: Re: [Qemu-devel] [PATCH 05/13] vmxnet3: Use generic function for DSN capability definition List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leonid Bloch Cc: Dmitry Fleytman , Jason Wang , Leonid Bloch , qemu-devel@nongnu.org, Shmulik Ladkani On Thu, Feb 18, 2016 at 12:07:26PM +0200, Leonid Bloch wrote: > From: Dmitry Fleytman > > Signed-off-by: Dmitry Fleytman > Signed-off-by: Leonid Bloch > --- > hw/net/vmxnet3.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c > index 093a71e..43f7a34 100644 > --- a/hw/net/vmxnet3.c > +++ b/hw/net/vmxnet3.c > @@ -2313,10 +2313,8 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp) > pcie_endpoint_cap_init(pci_dev, VMXNET3_EXP_EP_OFFSET); > } > > - pcie_add_capability(pci_dev, PCI_EXT_CAP_ID_DSN, 0x1, > - VMXNET3_DSN_OFFSET, PCI_EXT_CAP_DSN_SIZEOF); > - memcpy(pci_dev->config + VMXNET3_DSN_OFFSET + 4, > - vmxnet3_device_serial_num(s), sizeof(uint64_t)); > + pcie_dsn_init(pci_dev, VMXNET3_DSN_OFFSET, > + *(uint64_t *) vmxnet3_device_serial_num(s)); Can't we fix the API to avoid the cast? > } > > register_savevm(dev, "vmxnet3-msix", -1, 1, > -- > 2.5.0