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]
Date:	Fri,  8 Jul 2016 19:30:33 +0900
From:	Masahiro Yamada <yamada.masahiro@...ionext.com>
To:	linux-kernel@...r.kernel.org
Cc:	Hans de Goede <hdegoede@...hat.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Lee Jones <lee.jones@...aro.org>,
	Masahiro Yamada <yamada.masahiro@...ionext.com>
Subject: [PATCH] reset: add WARN_ON(1) to non-optional reset_control_get variants

The difference between with/without _optional variants is WARN_ON(1)
when CONFIG_RESET_CONTROLLER is not defined.

Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>

---

 include/linux/reset.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/linux/reset.h b/include/linux/reset.h
index 45a4abe..cb7db61 100644
--- a/include/linux/reset.h
+++ b/include/linux/reset.h
@@ -132,6 +132,9 @@ __must_check reset_control_get_exclusive(struct device *dev, const char *id)
 static inline struct reset_control *reset_control_get_shared(
 					struct device *dev, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(dev ? dev->of_node : NULL, id, 0, 1);
 }
 
@@ -160,6 +163,9 @@ static inline struct reset_control *reset_control_get_optional_shared(
 static inline struct reset_control *of_reset_control_get_exclusive(
 				struct device_node *node, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, id, 0, 0);
 }
 
@@ -185,6 +191,9 @@ static inline struct reset_control *of_reset_control_get_exclusive(
 static inline struct reset_control *of_reset_control_get_shared(
 				struct device_node *node, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, id, 0, 1);
 }
 
@@ -202,6 +211,9 @@ static inline struct reset_control *of_reset_control_get_shared(
 static inline struct reset_control *of_reset_control_get_exclusive_by_index(
 					struct device_node *node, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, NULL, index, 0);
 }
 
@@ -230,6 +242,9 @@ static inline struct reset_control *of_reset_control_get_exclusive_by_index(
 static inline struct reset_control *of_reset_control_get_shared_by_index(
 					struct device_node *node, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __of_reset_control_get(node, NULL, index, 1);
 }
 
@@ -267,6 +282,9 @@ __must_check devm_reset_control_get_exclusive(struct device *dev,
 static inline struct reset_control *devm_reset_control_get_shared(
 					struct device *dev, const char *id)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, id, 0, 1);
 }
 
@@ -297,6 +315,9 @@ static inline struct reset_control *devm_reset_control_get_optional_shared(
 static inline struct reset_control *
 devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, NULL, index, 0);
 }
 
@@ -313,6 +334,9 @@ devm_reset_control_get_exclusive_by_index(struct device *dev, int index)
 static inline struct reset_control *
 devm_reset_control_get_shared_by_index(struct device *dev, int index)
 {
+#ifndef CONFIG_RESET_CONTROLLER
+	WARN_ON(1);
+#endif
 	return __devm_reset_control_get(dev, NULL, index, 1);
 }
 
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ