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]
Date:	Tue,  5 Jan 2016 23:03:39 +0800
From:	Geliang Tang <geliangtang@....com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Geliang Tang <geliangtang@....com>, linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] driver core: bus: add a new helper to_driver_private_bus

Add a new helper to_driver_private_bus() for consistency with
to_device_private_bus() and use it in bus.c.

Signed-off-by: Geliang Tang <geliangtang@....com>
---
 drivers/base/base.h | 2 ++
 drivers/base/bus.c  | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/base/base.h b/drivers/base/base.h
index e05db38..88119d6 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -51,6 +51,8 @@ struct driver_private {
 	struct device_driver *driver;
 };
 #define to_driver(obj) container_of(obj, struct driver_private, kobj)
+#define to_driver_private_bus(obj)	\
+	container_of(obj, struct driver_private, knode_bus)
 
 /**
  * struct device_private - structure to hold the private to the driver core portions of the device structure.
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 6470eb8..ddc2b0b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -422,7 +422,7 @@ static struct device_driver *next_driver(struct klist_iter *i)
 	struct driver_private *drv_priv;
 
 	if (n) {
-		drv_priv = container_of(n, struct driver_private, knode_bus);
+		drv_priv = to_driver_private_bus(n);
 		return drv_priv->driver;
 	}
 	return NULL;
-- 
2.5.0


--
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