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>] [day] [month] [year] [list]
Message-Id: <20210824070747.61163-1-deng.changcheng@zte.com.cn>
Date:   Tue, 24 Aug 2021 00:07:47 -0700
From:   CGEL <cgel.zte@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>, x86@...nel.org,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] x86:lbr: fix boolreturn.cocci warnings

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

./arch/x86/events/intel/lbr.c:925:9-10:WARNING: return of 0/1 in
function 'get_lbr_mispred' with return type bool
./arch/x86/events/intel/lbr.c:933:9-10:WARNING: return of 0/1 in
function 'get_lbr_predicted' with return type bool

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>
---
 arch/x86/events/intel/lbr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index 9e6d6ea..c803282 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -922,7 +922,7 @@ static __always_inline int get_lbr_br_type(u64 info)
 static __always_inline bool get_lbr_mispred(u64 info)
 {
 	if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
-		return 0;
+		return false;
 
 	return !!(info & LBR_INFO_MISPRED);
 }
@@ -930,7 +930,7 @@ static __always_inline bool get_lbr_mispred(u64 info)
 static __always_inline bool get_lbr_predicted(u64 info)
 {
 	if (static_cpu_has(X86_FEATURE_ARCH_LBR) && !x86_pmu.lbr_mispred)
-		return 0;
+		return false;
 
 	return !(info & LBR_INFO_MISPRED);
 }
-- 
1.8.3.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ