AMD IOMMU: use __ioapic_read_entry() instead of open coding it
authorJan Beulich <jbeulich@suse.com>
Mon, 18 Feb 2013 08:38:25 +0000 (09:38 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Feb 2013 08:38:25 +0000 (09:38 +0100)
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/drivers/passthrough/amd/iommu_intr.c

index 4ae5a540791adaf7f29d7517c85829dad230799b..49ed3a2ab24d87499fd9c34512c19b780dd8b05d 100644 (file)
@@ -144,7 +144,7 @@ static void update_intremap_entry_from_ioapic(
 
 int __init amd_iommu_setup_ioapic_remapping(void)
 {
-    struct IO_APIC_route_entry rte = {0};
+    struct IO_APIC_route_entry rte;
     unsigned long flags;
     u32* entry;
     int apic, pin;
@@ -159,9 +159,7 @@ int __init amd_iommu_setup_ioapic_remapping(void)
     {
         for ( pin = 0; pin < nr_ioapic_entries[apic]; pin++ )
         {
-            *(((int *)&rte) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
-            *(((int *)&rte) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
-
+            rte = __ioapic_read_entry(apic, pin, 1);
             if ( rte.mask == 1 )
                 continue;