lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-c179c9b978b90bdf9cb39f5b5716dede157f1eaf@git.kernel.org>
Date:	Wed, 22 Jul 2015 13:37:29 -0700
From:	tip-bot for Jiang Liu <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	bhelgaas@...gle.com, grant.likely@...aro.org, marc.zyngier@....com,
	wangyijing@...wei.com, agordeev@...hat.com, tony.luck@...el.com,
	linux-kernel@...r.kernel.org, jiang.liu@...ux.intel.com,
	mingo@...nel.org, hpa@...or.com, tglx@...utronix.de,
	stuart.yoder@...escale.com, bp@...en8.de
Subject: [tip:irq/core] PCI: Add helper function msi_desc_to_pci_sysdata()

Commit-ID:  c179c9b978b90bdf9cb39f5b5716dede157f1eaf
Gitweb:     http://git.kernel.org/tip/c179c9b978b90bdf9cb39f5b5716dede157f1eaf
Author:     Jiang Liu <jiang.liu@...ux.intel.com>
AuthorDate: Thu, 9 Jul 2015 16:00:36 +0800
Committer:  Thomas Gleixner <tglx@...utronix.de>
CommitDate: Wed, 22 Jul 2015 18:37:42 +0200

PCI: Add helper function msi_desc_to_pci_sysdata()

Add helper function msi_desc_to_pci_sysdata() to retrieve sysdata from
an MSI descriptor. To avoid pulling include/linux/pci.h into
include/linux/msi.h, msi_desc_to_pci_sysdata() is implemented as a normal
function instead of an inline function.

Signed-off-by: Jiang Liu <jiang.liu@...ux.intel.com>
Reviewed-by: Yijing Wang <wangyijing@...wei.com>
Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: linux-arm-kernel@...ts.infradead.org
Cc: Grant Likely <grant.likely@...aro.org>
Cc: Marc Zyngier <marc.zyngier@....com>
Cc: Stuart Yoder <stuart.yoder@...escale.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Alexander Gordeev <agordeev@...hat.com>
Link: http://lkml.kernel.org/r/1436428847-8886-2-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
 drivers/pci/msi.c   | 8 ++++++++
 include/linux/msi.h | 7 +++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 157eb88..ab41742 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1137,6 +1137,14 @@ int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
 }
 EXPORT_SYMBOL(pci_enable_msix_range);
 
+void *msi_desc_to_pci_sysdata(struct msi_desc *desc)
+{
+	struct pci_dev *dev = msi_desc_to_pci_dev(desc);
+
+	return dev->bus->sysdata;
+}
+EXPORT_SYMBOL_GPL(msi_desc_to_pci_sysdata);
+
 #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
 /**
  * pci_msi_domain_write_msg - Helper to write MSI message to PCI config space
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 8ac4a68..cfbd2af 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -60,6 +60,13 @@ static inline struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
 {
 	return desc->dev;
 }
+
+void *msi_desc_to_pci_sysdata(struct msi_desc *desc);
+#else /* CONFIG_PCI_MSI */
+static inline void *msi_desc_to_pci_sysdata(struct msi_desc *desc)
+{
+	return NULL;
+}
 #endif /* CONFIG_PCI_MSI */
 
 void __pci_read_msi_msg(struct msi_desc *entry, struct msi_msg *msg);
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ