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>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Aug 2021 23:45:03 -0700
From:   CGEL <cgel.zte@...il.com>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Frank Rowand <frowand.list@...il.com>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] scripts/dtc/util: fix boolreturn.cocci warnings

From: Jing Yangyang <jing.yangyang@....com.cn>

Return statements in functions returning bool should use true/false
instead of 1/0.

Generated by: scripts/coccinelle/misc/boolreturn.cocci

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@....com.cn>
---
 scripts/dtc/util.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/dtc/util.c b/scripts/dtc/util.c
index 40274fb..1faded1 100644
--- a/scripts/dtc/util.c
+++ b/scripts/dtc/util.c
@@ -112,11 +112,11 @@ bool util_is_printable_string(const void *data, int len)
 
 	/* zero length is not */
 	if (len == 0)
-		return 0;
+		return false;
 
 	/* must terminate with zero */
 	if (s[len - 1] != '\0')
-		return 0;
+		return false;
 
 	se = s + len;
 
@@ -127,12 +127,12 @@ bool util_is_printable_string(const void *data, int len)
 
 		/* not zero, or not done yet */
 		if (*s != '\0' || s == ss)
-			return 0;
+			return false;
 
 		s++;
 	}
 
-	return 1;
+	return true;
 }
 
 /*
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ