From patchwork Fri Jun 17 00:30:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 9181991 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2DF876088F for ; Fri, 17 Jun 2016 00:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F2D12839B for ; Fri, 17 Jun 2016 00:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 140E02839E; Fri, 17 Jun 2016 00:47:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 87D552839C for ; Fri, 17 Jun 2016 00:47:57 +0000 (UTC) Received: from localhost ([::1]:52936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDhwy-0005uY-MO for patchwork-qemu-devel@patchwork.kernel.org; Thu, 16 Jun 2016 20:47:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDhgh-0005gR-SW for qemu-devel@nongnu.org; Thu, 16 Jun 2016 20:31:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDhge-0006PT-M3 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 20:31:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDhge-0006PO-Gf for qemu-devel@nongnu.org; Thu, 16 Jun 2016 20:31:04 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0EF9D83F44; Fri, 17 Jun 2016 00:31:04 +0000 (UTC) Received: from redhat.com (vpn1-5-5.ams2.redhat.com [10.36.5.5]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u5H0UxSD017086; Thu, 16 Jun 2016 20:30:59 -0400 Date: Fri, 17 Jun 2016 03:30:58 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <20160617033058-mutt-send-email-mst@redhat.com> References: <1466123354-22896-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1466123354-22896-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 17 Jun 2016 00:31:04 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v3 14/15] msi_init: change return value to 0 on success X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Hannes Reinecke , Markus Armbruster , Cao jin , Hannes Reinecke , Marcel Apfelbaum , Paolo Bonzini Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cao jin No caller use its return value as msi capability offset, also in order to make its return behaviour consistent with msix_init(). cc: Michael S. Tsirkin cc: Paolo Bonzini cc: Hannes Reinecke cc: Markus Armbruster cc: Marcel Apfelbaum Acked-by: Hannes Reinecke Reviewed-by: Markus Armbruster Signed-off-by: Cao jin Reviewed-by: Markus Armbruster Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/pci/msi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/pci/msi.c b/hw/pci/msi.c index 359058e..ed79225 100644 --- a/hw/pci/msi.c +++ b/hw/pci/msi.c @@ -173,8 +173,7 @@ bool msi_enabled(const PCIDevice *dev) * If @msi64bit, make the device capable of sending a 64-bit message * address. * If @msi_per_vector_mask, make the device support per-vector masking. - * Return the offset of capability MSI in config space on success, - * return -errno on error. + * Return 0 on success, return -errno on error. * * -ENOTSUP means lacking msi support for a msi-capable platform. * -EINVAL means capability overlap, happens when @offset is non-zero, @@ -236,7 +235,8 @@ int msi_init(struct PCIDevice *dev, uint8_t offset, pci_set_long(dev->wmask + msi_mask_off(dev, msi64bit), 0xffffffff >> (PCI_MSI_VECTORS_MAX - nr_vectors)); } - return config_offset; + + return 0; } void msi_uninit(struct PCIDevice *dev)