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, 10 Mar 2023 08:47:22 -0600
From:   Rob Herring <robh@...nel.org>
To:     "David S. Miller" <davem@...emloft.net>
Cc:     devicetree@...r.kernel.org, sparclinux@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH] sbus: display7seg: Use of_property_read_bool() for boolean properties

It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@...nel.org>
---
 drivers/sbus/char/display7seg.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/sbus/char/display7seg.c b/drivers/sbus/char/display7seg.c
index d93595b39afa..8bee31f03126 100644
--- a/drivers/sbus/char/display7seg.c
+++ b/drivers/sbus/char/display7seg.c
@@ -31,8 +31,8 @@ static int sol_compat = 0;		/* Solaris compatibility mode	*/
 
 /* Solaris compatibility flag -
  * The Solaris implementation omits support for several
- * documented driver features (ref Sun doc 806-0180-03).  
- * By default, this module supports the documented driver 
+ * documented driver features (ref Sun doc 806-0180-03).
+ * By default, this module supports the documented driver
  * abilities, rather than the Solaris implementation:
  *
  * 	1) Device ALWAYS reverts to OBP-specified FLIPPED mode
@@ -44,7 +44,7 @@ static int sol_compat = 0;		/* Solaris compatibility mode	*/
  * omitting above features, set this parameter to non-zero.
  */
 module_param(sol_compat, int, 0);
-MODULE_PARM_DESC(sol_compat, 
+MODULE_PARM_DESC(sol_compat,
 		 "Disables documented functionality omitted from Solaris driver");
 
 MODULE_AUTHOR("Eric Brower <ebrower@....net>");
@@ -63,7 +63,7 @@ struct d7s *d7s_device;
  * | DP | ALARM | FLIP | 4 | 3 | 2 | 1 | 0 |
  * -----------------------------------------
  *
- * DP 		- Toggles decimal point on/off 
+ * DP 		- Toggles decimal point on/off
  * ALARM	- Toggles "Alarm" LED green/red
  * FLIP		- Inverts display for upside-down mounted board
  * bits 0-4	- 7-segment display contents
@@ -200,9 +200,8 @@ static int d7s_probe(struct platform_device *op)
 	 */
 	regs = readb(p->regs);
 	opts = of_find_node_by_path("/options");
-	if (opts &&
-	    of_get_property(opts, "d7s-flipped?", NULL))
-		p->flipped = true;
+	if (opts)
+	    p->flipped = of_property_read_bool(opts, "d7s-flipped?");
 
 	if (p->flipped)
 		regs |= D7S_FLIP;
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ