x86/MSI: Replace msi_update_msg() with irq_chip_compose_msi_msg()
authorJiang Liu <[email protected]>
Mon, 13 Apr 2015 06:11:47 +0000 (14:11 +0800)
committerThomas Gleixner <[email protected]>
Fri, 24 Apr 2015 13:36:50 +0000 (15:36 +0200)
Function irq_chip_compose_msi_msg() can achieve the same goal as
msi_update_msg(), so remove msi_update_msg().

Signed-off-by: Jiang Liu <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: David Cohen <[email protected]>
Cc: Sander Eikelenboom <[email protected]>
Cc: David Vrabel <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Dimitri Sivanich <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Gleixner <[email protected]>
arch/x86/kernel/apic/msi.c

index 87df03ae99ba0b09ec71cfacc2b367dfafda84aa..5b5ef5bd23f51a6fcddc1f9fbd5a357e848d7fb4 100644 (file)
@@ -53,19 +53,6 @@ static void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
                MSI_DATA_VECTOR(cfg->vector);
 }
 
-static void msi_update_msg(struct msi_msg *msg, struct irq_data *irq_data)
-{
-       struct irq_cfg *cfg = irqd_cfg(irq_data);
-
-       msg->data &= ~MSI_DATA_VECTOR_MASK;
-       msg->data |= MSI_DATA_VECTOR(cfg->vector);
-       msg->address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-       msg->address_lo |= MSI_ADDR_DEST_ID(cfg->dest_apicid);
-       if (x2apic_enabled())
-               msg->address_hi = MSI_ADDR_BASE_HI |
-                                 MSI_ADDR_EXT_DEST_ID(cfg->dest_apicid);
-}
-
 /*
  * IRQ Chip for MSI PCI/PCI-X/PCI-Express Devices,
  * which implement the MSI or MSI-X Capability Structure.
@@ -198,8 +185,7 @@ dmar_msi_set_affinity(struct irq_data *data, const struct cpumask *mask,
 
        ret = parent->chip->irq_set_affinity(parent, mask, force);
        if (ret >= 0) {
-               dmar_msi_read(data->irq, &msg);
-               msi_update_msg(&msg, data);
+               irq_chip_compose_msi_msg(data, &msg);
                dmar_msi_write(data->irq, &msg);
        }
 
@@ -329,8 +315,7 @@ static int hpet_msi_set_affinity(struct irq_data *data,
 
        ret = parent->chip->irq_set_affinity(parent, mask, force);
        if (ret >= 0 && ret != IRQ_SET_MASK_OK_DONE) {
-               hpet_msi_read(data->handler_data, &msg);
-               msi_update_msg(&msg, data);
+               irq_chip_compose_msi_msg(data, &msg);
                hpet_msi_write(data->handler_data, &msg);
        }