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]
Message-Id: <20200327212358.5752-10-jbi.octave@gmail.com>
Date:   Fri, 27 Mar 2020 21:23:56 +0000
From:   Jules Irenge <jbi.octave@...il.com>
To:     julia.lawall@...6.fr
Cc:     boqun.feng@...il.com, Luis Chamberlain <mcgrof@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Iurii Zaikin <yzaikin@...gle.com>,
        linux-kernel@...r.kernel.org (open list:PROC SYSCTL),
        linux-fsdevel@...r.kernel.org (open list:PROC SYSCTL)
Subject: [PATCH 09/10] kernel/sysctl.c: Replace 1 and 0 by corresponding boolean value

Coccinelle reports a warning

WARNING: Assignment of 0/1 to bool variable

To fix this, values 1 and 0 of first variable
are replaced by true and false respectively.
Given that variable first is of bool type.
This fixes the warnings.

Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
 kernel/sysctl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ad5b88a53c5a..4132a35e85bd 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -3158,7 +3158,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
 			 void __user *buffer, size_t *lenp, loff_t *ppos)
 {
 	int err = 0;
-	bool first = 1;
+	bool first = true;
 	size_t left = *lenp;
 	unsigned long bitmap_len = table->maxlen;
 	unsigned long *bitmap = *(unsigned long **) table->data;
@@ -3249,7 +3249,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
 			}
 
 			bitmap_set(tmp_bitmap, val_a, val_b - val_a + 1);
-			first = 0;
+			first = false;
 			proc_skip_char(&p, &left, '\n');
 		}
 		kfree(kbuf);
@@ -3281,7 +3281,7 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
 					break;
 			}
 
-			first = 0; bit_b++;
+			first = false; bit_b++;
 		}
 		if (!err)
 			err = proc_put_char(&buffer, &left, '\n');
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ