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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri, 14 Jun 2019 18:54:06 +0100
From:   Suzuki K Poulose <suzuki.poulose@....com>
To:     linux-kernel@...r.kernel.org
Cc:     gregkh@...uxfoundation.org, rafael@...nel.org,
        suzuki.poulose@....com, Bjorn Helgaas <bhelgaas@...gle.com>,
        Elie Morisse <syniurge@...il.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Nehal Shah <nehal-bakulchandra.shah@....com>,
        "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
        Shyam Sundar S K <shyam-sundar.s-k@....com>
Subject: [PATCH v2 11/28] drivers: Add generic helper to match any device

Add a generic helper to match any/all devices. This will be
used for providing {bus/driver/class}_find_next_device()

Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: Elie Morisse <syniurge@...il.com>
Cc: "James E.J. Bottomley" <jejb@...ux.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: Nehal Shah <nehal-bakulchandra.shah@....com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>
Cc: Shyam Sundar S K <shyam-sundar.s-k@....com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
---
 drivers/base/core.c    | 6 ++++++
 include/linux/device.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 5724f93..053ee2e 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -3358,3 +3358,9 @@ int device_match_name(struct device *dev, const void *name)
 	return sysfs_streq(dev_name(dev), name);
 }
 EXPORT_SYMBOL_GPL(device_match_name);
+
+int device_match_any(struct device *dev, const void *unused)
+{
+	return 1;
+}
+EXPORT_SYMBOL_GPL(device_match_any);
diff --git a/include/linux/device.h b/include/linux/device.h
index b9b82b7..a449d09 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -168,6 +168,7 @@ int device_match_fwnode(struct device *dev, const void *fwnode);
 int device_match_devt(struct device *dev, const void *pdevt);
 int device_match_acpi_dev(struct device *dev, const void *adev);
 int device_match_name(struct device *dev, const void *name);
+int device_match_any(struct device *dev, const void *unused);
 
 int bus_for_each_dev(struct bus_type *bus, struct device *start, void *data,
 		     int (*fn)(struct device *dev, void *data));
-- 
2.7.4

Powered by blists - more mailing lists