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


Groups > linux.kernel > #1428347

[PATCH] PCI/MSI: Simplify the return value of arch_setup_msi_irqs

From Shawn Lin <shawn.lin@rock-chips.com>
Newsgroups linux.kernel
Subject [PATCH] PCI/MSI: Simplify the return value of arch_setup_msi_irqs
Date 2016-06-22 04:30 +0200
Message-ID <rMG5r-5Ol-3@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


No any callers do care whether arch_setup_msi_irqs returns
-ENOSPC or other error numbers. That means they treat the
negative numbers in the same way. So there shouldn't make any
difference to directly return -ENOSPC if finding it's non-zero.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/pci/msi.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a080f44..4a40b72 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -108,7 +108,7 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 {
 	struct msi_controller *chip = dev->bus->msi;
 	struct msi_desc *entry;
-	int ret;
+	int ret = 0;
 
 	if (chip && chip->setup_irqs)
 		return chip->setup_irqs(chip, dev, nvec, type);
@@ -119,13 +119,10 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	if (type == PCI_CAP_ID_MSI && nvec > 1)
 		return 1;
 
-	for_each_pci_msi_entry(entry, dev) {
+	for_each_pci_msi_entry(entry, dev)
 		ret = arch_setup_msi_irq(dev, entry);
-		if (ret < 0)
-			return ret;
-		if (ret > 0)
+		if (ret)
 			return -ENOSPC;
-	}
 
 	return 0;
 }
-- 
2.3.7

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] PCI/MSI: Simplify the return value of arch_setup_msi_irqs Shawn Lin <shawn.lin@rock-chips.com> - 2016-06-22 04:30 +0200
  Re: [PATCH] PCI/MSI: Simplify the return value of arch_setup_msi_irqs kbuild test robot <lkp@intel.com> - 2016-06-22 05:20 +0200

csiph-web