Fix the error handling of msi setup, the return value of failure
is -1, not 0.
Signed-off-by: Qing He <qing.he@xxxxxxxxx>
---
arch/x86/xen/pci.c | 5 ++---
drivers/xen/events.c | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/arch/x86/xen/pci.c b/arch/x86/xen/pci.c
index 60bab67..44d91ad 100644
--- a/arch/x86/xen/pci.c
+++ b/arch/x86/xen/pci.c
@@ -90,13 +90,12 @@ void __init xen_setup_pirqs(void)
#ifdef CONFIG_PCI_MSI
int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
- unsigned int irq;
- int ret;
+ int irq, ret;
struct msi_desc *msidesc;
list_for_each_entry(msidesc, &dev->msi_list, list) {
irq = xen_create_msi_irq(dev, msidesc, type);
- if (irq == 0)
+ if (irq < 0)
return -1;
ret = set_irq_msi(irq, msidesc);
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 007b1d7..a3d430b 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -591,7 +591,7 @@ int xen_destroy_irq(int irq)
unmap_irq.domid = DOMID_SELF;
rc = HYPERVISOR_physdev_op(PHYSDEVOP_unmap_pirq, &unmap_irq);
if (rc) {
- printk(KERN_WARNING "unmap irq failed %x\n", rc);
+ printk(KERN_WARNING "unmap irq failed %d\n", rc);
goto out;
}
@@ -643,7 +643,7 @@ int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc
*msidesc, int type)
rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
if (rc) {
- printk(KERN_WARNING "xen map irq failed %x\n", rc);
+ printk(KERN_WARNING "xen map irq failed %d\n", rc);
dynamic_irq_cleanup(irq);
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|