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:   Mon, 9 Nov 2020 19:59:50 +0800
From:   Zou Wei <zou_wei@...wei.com>
To:     <paul.gortmaker@...driver.com>, <paulmck@...nel.org>,
        <peterz@...radead.org>, <akpm@...ux-foundation.org>,
        <abelits@...vell.com>
CC:     <pjt@...gle.com>, <jinyuqi@...wei.com>,
        <linux-kernel@...r.kernel.org>, Zou Wei <zou_wei@...wei.com>
Subject: [PATCH -next] cpumask: use false and true for bool variables

Fix coccicheck warnings:

./lib/cpumask.c:342:6-13: WARNING: Comparison of 0/1 to bool variable
./lib/cpumask.c:351:33-40: WARNING: Comparison of 0/1 to bool variable
./lib/cpumask.c:406:3-11: WARNING: Assignment of 0/1 to bool variable

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zou Wei <zou_wei@...wei.com>
---
 lib/cpumask.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/cpumask.c b/lib/cpumask.c
index 34ecb30..74d0cf1 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -339,7 +339,7 @@ static int find_nearest_node(int *node_dist, bool *used)
 
 	/* Choose the first unused node to compare */
 	for (i = 0; i < nr_node_ids; i++) {
-		if (used[i] == 0) {
+		if (used[i] == false) {
 			min_dist = node_dist[i];
 			node_id = i;
 			break;
@@ -348,7 +348,7 @@ static int find_nearest_node(int *node_dist, bool *used)
 
 	/* Compare and return the nearest node */
 	for (i = 0; i < nr_node_ids; i++) {
-		if (node_dist[i] < min_dist && used[i] == 0) {
+		if (node_dist[i] < min_dist && used[i] == false) {
 			min_dist = node_dist[i];
 			node_id = i;
 		}
@@ -403,7 +403,7 @@ unsigned int cpumask_local_spread(unsigned int i, int node)
 							       flags);
 					return cpu;
 				}
-			used[id] = 1;
+			used[id] = true;
 		}
 		spin_unlock_irqrestore(&spread_lock, flags);
 
-- 
2.6.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ