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-next>] [day] [month] [year] [list]
Message-Id: <20201021081030.160-1-zhenzhong.duan@gmail.com>
Date:   Wed, 21 Oct 2020 16:10:29 +0800
From:   Zhenzhong Duan <zhenzhong.duan@...il.com>
To:     linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Cc:     bhelgaas@...gle.com, Zhenzhong Duan <zhenzhong.duan@...il.com>
Subject: [PATCH 1/2] PCI: export pci_match_device()

pci_match_id() is deprecated as it doesn't catch any dynamic ids that
a driver might want to check for.

Export pci_match_device() as a replacement which supports both dynamic
and static ids.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@...il.com>
---
 drivers/pci/pci-driver.c | 3 ++-
 include/linux/pci.h      | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index d1b7169..bd9cfd1 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -250,7 +250,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
  * system is in its list of supported devices.  Returns the matching
  * pci_device_id structure or %NULL if there is no match.
  */
-static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
+const struct pci_device_id *pci_match_device(struct pci_driver *drv,
 						    struct pci_dev *dev)
 {
 	struct pci_dynid *dynid;
@@ -279,6 +279,7 @@ static const struct pci_device_id *pci_match_device(struct pci_driver *drv,
 
 	return found_id;
 }
+EXPORT_SYMBOL(pci_match_device);
 
 struct drv_dev_and_id {
 	struct pci_driver *drv;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8355306..6f947c4 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1406,6 +1406,8 @@ int pci_add_dynid(struct pci_driver *drv,
 		  unsigned long driver_data);
 const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
 					 struct pci_dev *dev);
+const struct pci_device_id *pci_match_device(struct pci_driver *drv,
+					     struct pci_dev *dev);
 int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
 		    int pass);
 
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ