diff mbox

[v2] kvm: device-assignment: Fix kvm_get_irq_route_gsi() return check

Message ID 20090513044337.6737.29376.stgit@dl380g6-3.ned.telco.ned.telco (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Williamson May 13, 2009, 4:45 a.m. UTC
Use 'r' for the return value since gsi is unsigned.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---

 v2: Use 'r' instead of a cast, per Sheng Yang

 hw/device-assignment.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Yang, Sheng May 13, 2009, 4:58 a.m. UTC | #1
On Wednesday 13 May 2009 12:45:11 Alex Williamson wrote:
> Use 'r' for the return value since gsi is unsigned.
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> ---

Acked.
diff mbox

Patch

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index a6cc9b9..4107915 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -797,11 +797,12 @@  static void assigned_dev_update_msi(PCIDevice *pci_dev, unsigned int ctrl_pos)
         assigned_dev->entry->u.msi.data = *(uint16_t *)(pci_dev->config +
                 pci_dev->cap.start + PCI_MSI_DATA_32);
         assigned_dev->entry->type = KVM_IRQ_ROUTING_MSI;
-        assigned_dev->entry->gsi = kvm_get_irq_route_gsi(kvm_context);
-        if (assigned_dev->entry->gsi < 0) {
+        r = kvm_get_irq_route_gsi(kvm_context);
+        if (r < 0) {
             perror("assigned_dev_update_msi: kvm_get_irq_route_gsi");
             return;
         }
+        assigned_dev->entry->gsi = r;
 
         kvm_add_routing_entry(kvm_context, assigned_dev->entry);
         if (kvm_commit_irq_routes(kvm_context) < 0) {