Commit-ID:  51911edac211c75cef7c95d4874e2b1f77134a85
Gitweb:     http://git.kernel.org/tip/51911edac211c75cef7c95d4874e2b1f77134a85
Author:     Jiang Liu <jiang....@linux.intel.com>
AuthorDate: Tue, 25 Nov 2014 13:53:34 +0800
Committer:  Thomas Gleixner <t...@linutronix.de>
CommitDate: Wed, 26 Nov 2014 18:59:26 +0100

PCI/MSI: Replace msi_update_msg() with irq_chip_compose_msi_msg()

Function irq_chip_compose_msi_msg() can achieve the same goal as
msi_update_msg(), so kill msi_update_msg().

Signed-off-by: Jiang Liu <jiang....@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com>
Cc: Tony Luck <tony.l...@intel.com>
Cc: Joerg Roedel <j...@8bytes.org>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelg...@google.com>
Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org>
Cc: Rafael J. Wysocki <r...@rjwysocki.net>
Cc: Randy Dunlap <rdun...@infradead.org>
Cc: Yinghai Lu <ying...@kernel.org>
Cc: Borislav Petkov <b...@alien8.de>
Link: 
http://lkml.kernel.org/r/1416894816-23245-26-git-send-email-jiang....@linux.intel.com
Signed-off-by: Thomas Gleixner <t...@linutronix.de>
---
 arch/x86/kernel/apic/msi.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 8e8f243..15429aa 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -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);
        }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to