[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] MSI-X: Fix pciback_enable_msix().



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1220537411 -3600
# Node ID 7ec0d9030d8adcd8c98dd5ecd971a11fcb22512f
# Parent  c47b7e47ab1916a148f73c0c4a32823a00776a64
MSI-X: Fix pciback_enable_msix().
Signed-off-by: Yu Zhao <yu.zhao@xxxxxxxxx>
---
 drivers/xen/pciback/conf_space_capability_msi.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff -r c47b7e47ab19 -r 7ec0d9030d8a 
drivers/xen/pciback/conf_space_capability_msi.c
--- a/drivers/xen/pciback/conf_space_capability_msi.c   Thu Sep 04 11:30:39 
2008 +0100
+++ b/drivers/xen/pciback/conf_space_capability_msi.c   Thu Sep 04 15:10:11 
2008 +0100
@@ -37,22 +37,26 @@ int pciback_enable_msix(struct pciback_d
 int pciback_enable_msix(struct pciback_device *pdev,
                struct pci_dev *dev, struct xen_pci_op *op)
 {
+       int i;
        int result;
+       struct msix_entry entries[op->value];
 
        if (op->value > SH_INFO_MAX_VEC)
                return -EINVAL;
-       else {
-               struct msix_entry entries[op->value];
-               int i;
 
-               for (i = 0; i < op->value; i++) {
-                       entries[i].entry = op->msix_entries[i].entry;
-                       entries[i].vector = op->msix_entries[i].vector;
-               }
+       for (i = 0; i < op->value; i++) {
+               entries[i].entry = op->msix_entries[i].entry;
+               entries[i].vector = op->msix_entries[i].vector;
+       }
 
-               result = pci_enable_msix(dev, entries, op->value);
-               op->value = result;
+       result = pci_enable_msix(dev, entries, op->value);
+
+       for (i = 0; i < op->value; i++) {
+               op->msix_entries[i].entry = entries[i].entry;
+               op->msix_entries[i].vector = entries[i].vector;
        }
+
+       op->value = result;
 
        return result;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.