From: Qing He <qing.he@intel.com>
To: xen-devel@lists.xensource.com
Cc: jeremy@goop.org, yunhong.jiang@intel.com
Subject: [PATCH 1/2] xen: fix the error handling of msi setup
Date: Fri, 28 Aug 2009 16:28:48 +0800 [thread overview]
Message-ID: <20090828082848.GA9849@ub-qhe2> (raw)
Fix the error handling of msi setup, the return value of failure
is -1, not 0.
Signed-off-by: Qing He <qing.he@intel.com>
---
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);
next reply other threads:[~2009-08-28 8:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-28 8:28 Qing He [this message]
2009-08-28 8:29 ` [PATCH 2/2] xen: decouple irq and pirq for MSI Qing He
2009-08-28 18:22 ` [PATCH 1/2] xen: fix the error handling of msi setup Jeremy Fitzhardinge
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090828082848.GA9849@ub-qhe2 \
--to=qing.he@intel.com \
--cc=jeremy@goop.org \
--cc=xen-devel@lists.xensource.com \
--cc=yunhong.jiang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.