From patchwork Tue Aug 30 21:04:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Derrick X-Patchwork-Id: 9306037 X-Patchwork-Delegate: bhelgaas@google.com 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 5D6F7607F0 for ; Tue, 30 Aug 2016 21:06:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E46228D20 for ; Tue, 30 Aug 2016 21:06:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4317428D4F; Tue, 30 Aug 2016 21:06:50 +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 vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1D8628D20 for ; Tue, 30 Aug 2016 21:06:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754438AbcH3VGs (ORCPT ); Tue, 30 Aug 2016 17:06:48 -0400 Received: from mga05.intel.com ([192.55.52.43]:4455 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754578AbcH3VGs (ORCPT ); Tue, 30 Aug 2016 17:06:48 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 30 Aug 2016 14:06:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,258,1470726000"; d="scan'208";a="1043619262" Received: from nsgse-neoncity01.lm.intel.com (HELO nsgse-neoncity01.localdomain) ([10.232.118.5]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2016 14:06:47 -0700 From: Jon Derrick To: helgaas@kernel.org Cc: Jon Derrick , keith.busch@intel.com, linux-pci@vger.kernel.org Subject: [RFC 1/2] vmd: eliminate vmd_vector member from list type Date: Tue, 30 Aug 2016 15:04:56 -0600 Message-Id: <1472591097-19712-2-git-send-email-jonathan.derrick@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1472591097-19712-1-git-send-email-jonathan.derrick@intel.com> References: <1472591097-19712-1-git-send-email-jonathan.derrick@intel.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Eliminate unused vmd and vector members from vmd_irq_list and discover the vector using pci_irq_vector(). Signed-off-by: Jon Derrick --- arch/x86/pci/vmd.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/x86/pci/vmd.c b/arch/x86/pci/vmd.c index 4c0eac7..9320216 100644 --- a/arch/x86/pci/vmd.c +++ b/arch/x86/pci/vmd.c @@ -58,15 +58,12 @@ struct vmd_irq { /** * struct vmd_irq_list - list of driver requested IRQs mapping to a VMD vector * @irq_list: the list of irq's the VMD one demuxes to. - * @vmd_vector: the h/w IRQ assigned to the VMD. * @index: index into the VMD MSI-X table; used for message routing. * @count: number of child IRQs assigned to this vector; used to track * sharing. */ struct vmd_irq_list { struct list_head irq_list; - struct vmd_dev *vmd; - unsigned int vmd_vector; unsigned int index; unsigned int count; }; @@ -207,8 +204,10 @@ static int vmd_msi_init(struct irq_domain *domain, struct msi_domain_info *info, vmdirq->irq = vmd_next_irq(vmd, desc); vmdirq->virq = virq; - irq_domain_set_info(domain, virq, vmdirq->irq->vmd_vector, info->chip, - vmdirq, handle_untracked_irq, vmd, NULL); + irq_domain_set_info(domain, virq, + pci_irq_vector(vmd->dev, vmdirq->irq->index), + info->chip, vmdirq, + handle_untracked_irq, vmd, NULL); return 0; } @@ -690,10 +689,8 @@ static int vmd_probe(struct pci_dev *dev, const struct pci_device_id *id) for (i = 0; i < vmd->msix_count; i++) { INIT_LIST_HEAD(&vmd->irqs[i].irq_list); - vmd->irqs[i].vmd_vector = pci_irq_vector(dev, i); vmd->irqs[i].index = i; - - err = devm_request_irq(&dev->dev, vmd->irqs[i].vmd_vector, + err = devm_request_irq(&dev->dev, pci_irq_vector(dev, i), vmd_irq, 0, "vmd", &vmd->irqs[i]); if (err) return err;