[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1466565620-27183-1-git-send-email-shawn.lin@rock-chips.com>
Date: Wed, 22 Jun 2016 11:20:20 +0800
From: Shawn Lin <shawn.lin@...k-chips.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
Shawn Lin <shawn.lin@...k-chips.com>
Subject: [PATCH v2] PCI/MSI: Simplify the return value of arch_setup_msi_irqs
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@...k-chips.com>
---
Changes in v2:
- fix warning generated by -Wmisleading-indentation reported by Kbuild robot
drivers/pci/msi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a080f44..5057219 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);
@@ -121,9 +121,7 @@ int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
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;
}
--
2.3.7
Powered by blists - more mailing lists