[<prev] [next>] [day] [month] [year] [list]
Message-ID: <51EF44FA.4020903@oracle.com>
Date: Wed, 24 Jul 2013 11:07:38 +0800
From: Zhenzhong Duan <zhenzhong.duan@...cle.com>
To: linux-pci@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
xen-devel <xen-devel@...ts.xen.org>
CC: bhelgaas@...gle.com,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Feng Jin <joe.jin@...cle.com>,
Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
Subject: [PATCH 1/3] Refactor msi/msix restore code Part1
Move default_restore_msi_irqs down to reference some static function
msi_mask_irq and msix_mask_irq.
Tested-by: Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...cle.com>
---
drivers/pci/msi.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index aca7578..87223ae 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -96,26 +96,6 @@ void default_teardown_msi_irqs(struct pci_dev *dev)
# define HAVE_DEFAULT_MSI_RESTORE_IRQS
#endif
-#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
-void default_restore_msi_irqs(struct pci_dev *dev, int irq)
-{
- struct msi_desc *entry;
-
- entry = NULL;
- if (dev->msix_enabled) {
- list_for_each_entry(entry, &dev->msi_list, list) {
- if (irq == entry->irq)
- break;
- }
- } else if (dev->msi_enabled) {
- entry = irq_get_msi_desc(irq);
- }
-
- if (entry)
- write_msi_msg(irq, &entry->msg);
-}
-#endif
-
static void msi_set_enable(struct pci_dev *dev, int enable)
{
u16 control;
@@ -233,6 +213,26 @@ void unmask_msi_irq(struct irq_data *data)
#endif /* CONFIG_GENERIC_HARDIRQS */
+#ifdef HAVE_DEFAULT_MSI_RESTORE_IRQS
+void default_restore_msi_irqs(struct pci_dev *dev, int irq)
+{
+ struct msi_desc *entry;
+
+ entry = NULL;
+ if (dev->msix_enabled) {
+ list_for_each_entry(entry, &dev->msi_list, list) {
+ if (irq == entry->irq)
+ break;
+ }
+ } else if (dev->msi_enabled) {
+ entry = irq_get_msi_desc(irq);
+ }
+
+ if (entry)
+ write_msi_msg(irq, &entry->msg);
+}
+#endif
+
void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
{
BUG_ON(entry->dev->current_state != PCI_D0);
--
1.7.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists