Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1576734 > unrolled thread

two small PCI MSI cleanups V2

Started byChristoph Hellwig <hch@lst.de>
First post2017-02-08 18:20 +0100
Last post2017-02-10 21:40 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  two small PCI MSI cleanups V2 Christoph Hellwig <hch@lst.de> - 2017-02-08 18:20 +0100
    [PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs Christoph Hellwig <hch@lst.de> - 2017-02-08 18:20 +0100
      Re: [PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs Thomas Gleixner <tglx@linutronix.de> - 2017-02-08 19:40 +0100
    Re: two small PCI MSI cleanups V2 Bjorn Helgaas <helgaas@kernel.org> - 2017-02-10 21:40 +0100

#1576734 — two small PCI MSI cleanups V2

FromChristoph Hellwig <hch@lst.de>
Date2017-02-08 18:20 +0100
Subjecttwo small PCI MSI cleanups V2
Message-ID<t8E4p-377-3@gated-at.bofh.it>
Now with even more dead code removal thanks to the review from Thomas!

[toc] | [next] | [standalone]


#1576737 — [PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs

FromChristoph Hellwig <hch@lst.de>
Date2017-02-08 18:20 +0100
Subject[PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs
Message-ID<t8E4q-377-37@gated-at.bofh.it>
In reply to#1576734
Just call the msi_* version directly instead of having trivial wrappers
for one or two callsites.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/x86/kernel/apic/msi.c |  2 +-
 drivers/pci/msi.c          | 30 ++----------------------------
 include/linux/msi.h        |  3 ---
 3 files changed, 3 insertions(+), 32 deletions(-)

diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 015bbf30e3e3..c61aec7e65f4 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -82,7 +82,7 @@ int native_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	if (domain == NULL)
 		return -ENOSYS;
 
-	return pci_msi_domain_alloc_irqs(domain, dev, nvec, type);
+	return msi_domain_alloc_irqs(domain, &dev->dev, nvec);
 }
 
 void native_teardown_msi_irq(unsigned int irq)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 9de17f17a5d2..3f65efe02cc2 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -38,7 +38,7 @@ static int pci_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 
 	domain = dev_get_msi_domain(&dev->dev);
 	if (domain && irq_domain_is_hierarchy(domain))
-		return pci_msi_domain_alloc_irqs(domain, dev, nvec, type);
+		return msi_domain_alloc_irqs(domain, &dev->dev, nvec);
 
 	return arch_setup_msi_irqs(dev, nvec, type);
 }
@@ -49,7 +49,7 @@ static void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
 
 	domain = dev_get_msi_domain(&dev->dev);
 	if (domain && irq_domain_is_hierarchy(domain))
-		pci_msi_domain_free_irqs(domain, dev);
+		msi_domain_free_irqs(domain, &dev->dev);
 	else
 		arch_teardown_msi_irqs(dev);
 }
@@ -1462,32 +1462,6 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
 }
 EXPORT_SYMBOL_GPL(pci_msi_create_irq_domain);
 
-/**
- * pci_msi_domain_alloc_irqs - Allocate interrupts for @dev in @domain
- * @domain:	The interrupt domain to allocate from
- * @dev:	The device for which to allocate
- * @nvec:	The number of interrupts to allocate
- * @type:	Unused to allow simpler migration from the arch_XXX interfaces
- *
- * Returns:
- * A virtual interrupt number or an error code in case of failure
- */
-int pci_msi_domain_alloc_irqs(struct irq_domain *domain, struct pci_dev *dev,
-			      int nvec, int type)
-{
-	return msi_domain_alloc_irqs(domain, &dev->dev, nvec);
-}
-
-/**
- * pci_msi_domain_free_irqs - Free interrupts for @dev in @domain
- * @domain:	The interrupt domain
- * @dev:	The device for which to free interrupts
- */
-void pci_msi_domain_free_irqs(struct irq_domain *domain, struct pci_dev *dev)
-{
-	msi_domain_free_irqs(domain, &dev->dev);
-}
-
 static int get_msi_id_cb(struct pci_dev *pdev, u16 alias, void *data)
 {
 	u32 *pa = data;
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 18b8566b3ce3..1b6f3ebbe876 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -316,9 +316,6 @@ void pci_msi_domain_write_msg(struct irq_data *irq_data, struct msi_msg *msg);
 struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
 					     struct msi_domain_info *info,
 					     struct irq_domain *parent);
-int pci_msi_domain_alloc_irqs(struct irq_domain *domain, struct pci_dev *dev,
-			      int nvec, int type);
-void pci_msi_domain_free_irqs(struct irq_domain *domain, struct pci_dev *dev);
 irq_hw_number_t pci_msi_domain_calc_hwirq(struct pci_dev *dev,
 					  struct msi_desc *desc);
 int pci_msi_domain_check_cap(struct irq_domain *domain,
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1576810 — Re: [PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs

FromThomas Gleixner <tglx@linutronix.de>
Date2017-02-08 19:40 +0100
SubjectRe: [PATCH 2/2] PCI/msi: remove pci_msi_domain_{alloc,free}_irqs
Message-ID<t8FjP-3Oi-1@gated-at.bofh.it>
In reply to#1576737
On Wed, 8 Feb 2017, Christoph Hellwig wrote:

> Just call the msi_* version directly instead of having trivial wrappers
> for one or two callsites.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

[toc] | [prev] | [next] | [standalone]


#1578786

FromBjorn Helgaas <helgaas@kernel.org>
Date2017-02-10 21:40 +0100
Message-ID<t9q94-8hQ-23@gated-at.bofh.it>
In reply to#1576734
On Wed, Feb 08, 2017 at 06:17:42PM +0100, Christoph Hellwig wrote:
> Now with even more dead code removal thanks to the review from Thomas!

Both applied with Thomas' acks to pci/msi for v4.11, thanks!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web