* [PATCH] [POWERPC] unsigned hwirq cannot be negative
@ 2008-09-09 20:34 roel kluin
0 siblings, 0 replies; only message in thread
From: roel kluin @ 2008-09-09 20:34 UTC (permalink / raw)
To: galak, linux-kernel
This patch is not tested
---
fsl_msi_alloc_hwirqs() converts an int from bitmap_find_free_region()
into an irq_hw_number_t, but this can be an -ENOMEM. This is tested
in fsl_setup_msi_irqs(), but incorrectly: irq_hw_number_t is
unsigned.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index 2c5187c..a2aa59a 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -67,7 +67,7 @@ static struct irq_host_ops fsl_msi_host_ops = {
.map = fsl_msi_host_map,
};
-static irq_hw_number_t fsl_msi_alloc_hwirqs(struct fsl_msi *msi, int num)
+static int fsl_msi_alloc_hwirqs(struct fsl_msi *msi, int num)
{
unsigned long flags;
int order = get_count_order(num);
@@ -205,13 +205,13 @@ static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
struct fsl_msi *msi_data = fsl_msi;
list_for_each_entry(entry, &pdev->msi_list, list) {
- hwirq = fsl_msi_alloc_hwirqs(msi_data, 1);
- if (hwirq < 0) {
- rc = hwirq;
+ rc = fsl_msi_alloc_hwirqs(msi_data, 1);
+ if (rc < 0) {
pr_debug("%s: fail allocating msi interrupt\n",
__func__);
goto out_free;
}
+ hwirq = rc;
virq = irq_create_mapping(msi_data->irqhost, hwirq);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-09-09 20:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09 20:34 [PATCH] [POWERPC] unsigned hwirq cannot be negative roel kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).