lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf/x86/amd: Return true/false (not 1/0) from bool functions
Date
Return boolean values ("true" or "false") instead of 1 or 0 from bool
functions. This fixes the following warnings from coccicheck:

arch/x86/events/amd/brs.c:202:9-10: WARNING: return of 0/1 in function
'amd_brs_match_plm' with return type bool

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
---
arch/x86/events/amd/brs.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/events/amd/brs.c b/arch/x86/events/amd/brs.c
index 895c82165d85..44c80a3ab9f0 100644
--- a/arch/x86/events/amd/brs.c
+++ b/arch/x86/events/amd/brs.c
@@ -199,12 +199,12 @@ static bool amd_brs_match_plm(struct perf_event *event, u64 to)
int plm_u = PERF_SAMPLE_BRANCH_USER;

if (!(type & plm_k) && kernel_ip(to))
- return 0;
+ return false;

if (!(type & plm_u) && !kernel_ip(to))
- return 0;
+ return false;

- return 1;
+ return true;
}

/*
--
2.7.4
\
 
 \ /
  Last update: 2022-04-07 17:29    [W:0.428 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site