From patchwork Thu Sep 10 17:15:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 516367 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 76266140134 for ; Fri, 11 Sep 2015 04:06:59 +1000 (AEST) Received: from localhost ([::1]:50757 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za5tE-0006sy-PH for incoming@patchwork.ozlabs.org; Thu, 10 Sep 2015 13:44:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za5pS-00043R-H3 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 13:40:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Za5pR-0004p5-LG for qemu-devel@nongnu.org; Thu, 10 Sep 2015 13:40:10 -0400 Received: from smtp.citrix.com ([66.165.176.89]:53562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za5pR-0004ou-I4 for qemu-devel@nongnu.org; Thu, 10 Sep 2015 13:40:09 -0400 X-IronPort-AV: E=Sophos;i="5.17,506,1437436800"; d="scan'208";a="299244123" From: Stefano Stabellini To: Date: Thu, 10 Sep 2015 18:15:48 +0100 Message-ID: <1441905361-31967-16-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 X-DLP: MIA1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.165.176.89 Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Konrad Rzeszutek Wilk , Stefano Stabellini Subject: [Qemu-devel] [PULL 16/29] xen/pt: xen_host_pci_config_read returns -errno, not -1 on failure X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Konrad Rzeszutek Wilk 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 Signed-off-by: Stefano Stabellini --- 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 ba043e6..3b1544c 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -729,7 +729,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; }