From patchwork Fri Oct 18 17:12:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Gordeev X-Patchwork-Id: 3071301 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EC67BF924 for ; Sat, 19 Oct 2013 06:55:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A32E3203E1 for ; Sat, 19 Oct 2013 06:55:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CCDE820360 for ; Sat, 19 Oct 2013 06:55:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240Ab3JSGy7 (ORCPT ); Sat, 19 Oct 2013 02:54:59 -0400 Received: from 221-186-24-89.in-addr.arpa ([89.24.186.221]:14325 "EHLO dhcp-26-207.brq.redhat.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751027Ab3JSGy7 (ORCPT ); Sat, 19 Oct 2013 02:54:59 -0400 Received: from dhcp-26-207.brq.redhat.com (localhost [127.0.0.1]) by dhcp-26-207.brq.redhat.com (8.14.5/8.14.5) with ESMTP id r9IHDJik004741; Fri, 18 Oct 2013 19:13:19 +0200 Received: (from agordeev@localhost) by dhcp-26-207.brq.redhat.com (8.14.5/8.14.5/Submit) id r9IHDILl004740; Fri, 18 Oct 2013 19:13:18 +0200 From: Alexander Gordeev To: linux-kernel@vger.kernel.org Cc: Alexander Gordeev , Bjorn Helgaas , Michael Ellerman , Benjamin Herrenschmidt , Tejun Heo , Ben Hutchings , David Laight , Mark Lord , "H. Peter Anvin" , linux-pci@vger.kernel.org Subject: [PATCH RFC v2 08/29] PCI/MSI: Make pci_enable_msix() 'nvec' argument unsigned int Date: Fri, 18 Oct 2013 19:12:08 +0200 Message-Id: <93e145deeb238ad805196762cae696d3ae67f812.1382103786.git.agordeev@redhat.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: References: Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make pci_enable_msix() and pci_enable_msi_block() consistent with regard to the type of 'nvec' argument. Indeed, a number of vectors to allocate is a natural value, so make it unsigned. Signed-off-by: Alexander Gordeev --- Documentation/PCI/MSI-HOWTO.txt | 3 ++- drivers/pci/msi.c | 3 ++- include/linux/pci.h | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/PCI/MSI-HOWTO.txt b/Documentation/PCI/MSI-HOWTO.txt index a091780..845edb5 100644 --- a/Documentation/PCI/MSI-HOWTO.txt +++ b/Documentation/PCI/MSI-HOWTO.txt @@ -190,7 +190,8 @@ same number. 4.3.1 pci_enable_msix -int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) +int pci_enable_msix(struct pci_dev *dev, + struct msix_entry *entries, unsigned int nvec) Calling this function asks the PCI subsystem to allocate 'nvec' MSIs. The 'entries' argument is a pointer to an array of msix_entry structs diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index bbe3d3d..fdae3a4 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -932,7 +932,8 @@ int pci_msix_table_size(struct pci_dev *dev) * of irqs or MSI-X vectors available. Driver should use the returned value to * re-send its request. **/ -int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) +int pci_enable_msix(struct pci_dev *dev, + struct msix_entry *entries, unsigned int nvec) { int status, nr_entries; int i, j; diff --git a/include/linux/pci.h b/include/linux/pci.h index 5cfe54c..d6832de 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1167,7 +1167,7 @@ static inline int pci_msix_table_size(struct pci_dev *dev) return 0; } static inline int pci_enable_msix(struct pci_dev *dev, - struct msix_entry *entries, int nvec) + struct msix_entry *entries, int unsigned nvec) { return -ENOSYS; } @@ -1192,7 +1192,8 @@ int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec); void pci_msi_shutdown(struct pci_dev *dev); void pci_disable_msi(struct pci_dev *dev); int pci_msix_table_size(struct pci_dev *dev); -int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); +int pci_enable_msix(struct pci_dev *dev, + struct msix_entry *entries, unsigned int nvec); void pci_msix_shutdown(struct pci_dev *dev); void pci_disable_msix(struct pci_dev *dev); void msi_remove_pci_irq_vectors(struct pci_dev *dev);