Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2415941pxb; Tue, 9 Mar 2021 01:49:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyV0AnaOF66F1uZ6KbetrtnNUIXvdjG3FNPnWYbMOsglMzSa6OYlwEns/+GDhx8o2mjDd6 X-Received: by 2002:a17:906:3856:: with SMTP id w22mr19336212ejc.77.1615283358621; Tue, 09 Mar 2021 01:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615283358; cv=none; d=google.com; s=arc-20160816; b=diMpfkVnbnPAQb5hsjCesOxTMgNhIBIBAznm0qwjhpr9iWUbfIUrdhN0KPDpaBzxn2 Vp3ydlAitMsp4WESlxwP4hlpD1Kwo6x5PO64Ei5NckSj0V/6U1ZxGII/EEL5U3wgkOoV E1xyVzKGd+ZazlDrOX5tTFj4su6sFiiayg7NWVL7AWAtf1eqn6EsyKzOGLpb0H6RPi3T 0ZES6WDmSJttigvI8/5dsXxqX80TkRcxlQAw80V8/d6M4ZP02BdZvcbz3kLcGWa+frpQ juQPCmeqI95Y24quipKxOwgND5Xk9donbWDmVcCufXE85TGkqXQcWdOyyi+cv9UhSRI+ bCCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=ajsCQD/c3+XC7lGJHX6SKmSsCHTGvzghg+iAK7/Yh2k=; b=zp4uQPVIPyvTcWtVe7YWKQgfKsw+ALN+4aUWlZIaKFLlqBQuMVMF4XaHE7ozVa64Hi pF1BHtqpUYfeChjYOhkBddH5+IpbMqrM12jeoYLFVxk8nnfk6sZ0Ij6jAQvszlrZ5DfE ldoKjq91fDJemitoM6h729REqt/YoBTZHa4mHaHaeRWkaiBTLYf1HIDwez+hv6GeWBWM CoJHxcZb3SWoWs1eyzLkbt2rtQSTlTKID1wstTKIRtPz2VKZzkL77Su+YBg8SZWLTe2o oaGopFx8oNl/VwGOsTqtWy3E5Fm+Gkp7FxUT+KXqFcdB8xRyxiZMofES+XSrDp3MMYUA qB+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hy8si3561822ejc.489.2021.03.09.01.48.55; Tue, 09 Mar 2021 01:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230089AbhCIJpj (ORCPT + 99 others); Tue, 9 Mar 2021 04:45:39 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:49741 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229992AbhCIJpO (ORCPT ); Tue, 9 Mar 2021 04:45:14 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R461e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=12;SR=0;TI=SMTPD_---0UR6tdTj_1615283103; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UR6tdTj_1615283103) by smtp.aliyun-inc.com(127.0.0.1); Tue, 09 Mar 2021 17:45:11 +0800 From: Jiapeng Chong To: peterz@infradead.org Cc: mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, tglx@linutronix.de, bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] perf/x86/intel/lbr: Assign boolean values to a bool variable Date: Tue, 9 Mar 2021 17:45:02 +0800 Message-Id: <1615283102-47377-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Jiapeng Chong --- 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