Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp290135pxb; Thu, 25 Feb 2021 02:36:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJxA25xGv+FUeCwu5TW2d29MngM7MjS/71jdR+hIZF7PQulS0/JD8WaeKEYjz9QU3quXdZB4 X-Received: by 2002:a17:906:39d0:: with SMTP id i16mr2029953eje.165.1614249397015; Thu, 25 Feb 2021 02:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614249397; cv=none; d=google.com; s=arc-20160816; b=isAVsDAQn38rDP1TEWqP/u6zb+Tt8AoYDCYeVuAKNFqsiq685LHGIwXQybbW3Saslb Mdh4RwANvjJ+KhO6CLsJPmOxQ6zEzcc6nGD7eXJQ/q3bZz4HDgQ1qutLqB9YpaGpQwLZ jYTQ/7rRxKv+gQU+4vQxVvE0JDW7+JNQPpVYDzxmGcW10xfO/RnI1ri/0Ldu3eUt8upZ dZGtrjS42vHyw348Cx3LCH5AIiq6y2lb5MnYYW6F2B3ehRiHrZ+zkNA1IFTuCCpoKxrk GnRj4QJvgv/7oNRtb2dRi02fs4QNSclK9C61kLzmFVsxb6av9GJHLeFLlQl3h05whAPK jlYw== 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=thdWRhHmoUbiZYLLGHwnlvcDFP0B0n/g4bjE8FvcuW0=; b=UBEr1oAKv3tXMQJoaPdWnJBmFmvpLMLPv0meT+fIaFVbvEwtCVwCHygRgaS2Mt1pM2 A/ms7VNr+MUoGuuLya2h6nBi1AEbkzPG/LkgmSDUM/NVpm0fKl5OPmW4nET2DFnfdCqp gYx/YyzFh0vlWoRuc+DaA38RQMZQyYQrcinEQFNNthQwx5NTL+NZm8aboqXLPNvm27Po XWB38I9ArBw+0+l9hXcYBlzuBbnm9Npd05aS0Prm4RRCG4Na0bgnE3TL5QqhcJYfW2RI ke5xOHJ+xqHiacRRNzahnfoHGn3pftJufdDDueCRrPAu2VI/PeyoAl6YI1IDGYxY+jTl R7MA== 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 df18si3062721edb.41.2021.02.25.02.36.14; Thu, 25 Feb 2021 02:36:37 -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 S235199AbhBYKcz (ORCPT + 99 others); Thu, 25 Feb 2021 05:32:55 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:52518 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233938AbhBYKFe (ORCPT ); Thu, 25 Feb 2021 05:05:34 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0UPXARES_1614247485; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UPXARES_1614247485) by smtp.aliyun-inc.com(127.0.0.1); Thu, 25 Feb 2021 18:04:51 +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, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Jiapeng Chong Subject: [PATCH v2] perf machine: Use true and false for bool variable Date: Thu, 25 Feb 2021 18:04:43 +0800 Message-Id: <1614247483-102665-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: ./tools/perf/util/machine.c:2000:9-10: WARNING: return of 0/1 in function 'symbol__match_regex' with return type bool. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- Changes in v2: - Simplified logic. tools/perf/util/machine.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 1e9d3f9..3a69c4f 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1996,9 +1996,7 @@ int machine__process_event(struct machine *machine, union perf_event *event, static bool symbol__match_regex(struct symbol *sym, regex_t *regex) { - if (!regexec(regex, sym->name, 0, NULL, 0)) - return 1; - return 0; + return regexec(regex, sym->name, 0, NULL, 0) == 0; } static void ip__resolve_ams(struct thread *thread, -- 1.8.3.1