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]
Date:   Tue,  9 Mar 2021 17:45:02 +0800
From:   Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To:     peterz@...radead.org
Cc:     mingo@...hat.com, acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, tglx@...utronix.de, bp@...en8.de,
        x86@...nel.org, linux-kernel@...r.kernel.org,
        Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] perf/x86/intel/lbr: Assign boolean values to a bool variable

Fix the following coccicheck warnings:

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

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

Reported-by: Abaci Robot <abaci@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
 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 21890da..edf8247 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -906,7 +906,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);
 }
@@ -914,7 +914,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