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]
Message-Id: <20220518230953.112266-1-yang.lee@linux.alibaba.com>
Date:   Thu, 19 May 2022 07:09:53 +0800
From:   Yang Li <yang.lee@...ux.alibaba.com>
To:     chris@...kel.net
Cc:     jcmvbkbc@...il.com, linux-xtensa@...ux-xtensa.org,
        linux-kernel@...r.kernel.org, Yang Li <yang.lee@...ux.alibaba.com>,
        Abaci Robot <abaci@...ux.alibaba.com>
Subject: [PATCH -next] xtensa: Return true/false (not 1/0) from bool function

Return boolean values ("true" or "false") instead of 1 or 0 from bool
function. This fixes the following warnings from coccicheck:

./arch/xtensa/kernel/traps.c:304:10-11: WARNING: return of 0/1 in
function 'check_div0' with return type bool

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@...ux.alibaba.com>
---
 arch/xtensa/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/xtensa/kernel/traps.c b/arch/xtensa/kernel/traps.c
index f97d43a8d13d..0c25e035ff10 100644
--- a/arch/xtensa/kernel/traps.c
+++ b/arch/xtensa/kernel/traps.c
@@ -301,7 +301,7 @@ static bool check_div0(struct pt_regs *regs)
 
 	if (user_mode(regs)) {
 		if (copy_from_user(buf, (void __user *)regs->pc + 2, 5))
-			return 0;
+			return false;
 		p = buf;
 	} else {
 		p = (const u8 *)regs->pc + 2;
-- 
2.20.1.7.g153144c

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ