From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH v1 3/6] xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure Date: Thu, 2 Jul 2015 15:31:16 -0400 Message-ID: <1435865479-18329-4-git-send-email-konrad.wilk__45570.7709341825$1435865607$gmane$org@oracle.com> References: <1435865479-18329-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZAkCo-00062e-Ty for xen-devel@lists.xenproject.org; Thu, 02 Jul 2015 19:31:33 +0000 In-Reply-To: <1435865479-18329-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: stefano.stabellini@eu.citrix.com, xen-devel@lists.xenproject.org, qemu-devel@nongnu.org Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org However the init routines assume that on errors the return code is -1 (as the libxc API is) - while those xen_host_* routines follow another paradigm - negative errno on return, 0 on success. Reviewed-by: Stefano Stabellini Signed-off-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index 706e3d9..ea1ceda 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -716,7 +716,7 @@ static int xen_pt_initfn(PCIDevice *d) /* Initialize virtualized PCI configuration (Extended 256 Bytes) */ if (xen_host_pci_get_block(&s->real_device, 0, d->config, - PCI_CONFIG_SPACE_SIZE) == -1) { + PCI_CONFIG_SPACE_SIZE) < 0) { xen_host_pci_device_put(&s->real_device); return -1; } -- 2.1.0