Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp122611pxf; Wed, 10 Mar 2021 23:01:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVluKk2q+EW1f0O0Vf8ebb5aqJ/XkRYmdZc5IJP5Fn9jy3ARlSbgrPVWVUqvB6alnUhn5R X-Received: by 2002:a17:906:2dc1:: with SMTP id h1mr1665323eji.460.1615446115140; Wed, 10 Mar 2021 23:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615446115; cv=none; d=google.com; s=arc-20160816; b=BbFXINHBzBRbpPwo3nPUqzIuAXLUjUy23ykPlnr8jHY3uFUqtxeXE992TLNaoYSuIF IIHpY3zVLpT7XhsmT/a8OcN4I/hsJ8SbHZQPfI+9MdoSVpYNudhF2dQtEIdCqs8FMzCN 18HCyujzZRW3zlhxgrDe8rW/aH1pwtoR6gI6C3ALDJpMhcqIVj+G1fOxDr7lQKnx7Yym lYIQfrFN0+OW+loRs15x9KCAJIAFd8qn94+t8mx8C6/l+AknAyiPRWcDOu6A9pFzKhZ4 pFrUPRMKAL+cWOWIKhqkP+xSNcvTWpWrifKoG2AYKd3ZE7MwZs37Bt/11Mz5XWLqKI5O TJMQ== 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=O6/nviJ0TImMXPQ704P6JAQCaQfS/nmIlQFcMBaw37Q=; b=pxJpwTnXFEkCzpY+2yAO4L/WjZmpUQngbKEt0nkRXyme4DOGZCi6eskjyLYN6e0ivV o4JeIfY9qweWS6id6J3MWp6lv8AVvFz34gPcC81IU9PpOoHyilfdPWybEpKvgeN585Pl 5KmgYmSFz1VKX8IbT/ESF9ZqedpFyVUdLlHPsXWCp49YMB5I9u7aLDX6Oc8MMU3npABT bfRdsVVKmwR1qws+7apuIYzz6a/xnBUiwwsUKmqITLh7uae1dCo+34o5/e0ZeQWQgqF6 OFyrhKgHNwgNhArz/0HNsF5Gi4lkQrEgozbaAGmojrA94cw/qLc6x5W35LPUZzGq931o bCoA== 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 t18si1259176edr.399.2021.03.10.23.01.30; Wed, 10 Mar 2021 23:01:55 -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 S231295AbhCKHAV (ORCPT + 99 others); Thu, 11 Mar 2021 02:00:21 -0500 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:58021 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbhCKG7u (ORCPT ); Thu, 11 Mar 2021 01:59:50 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R321e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04394;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0URPRedH_1615445980; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0URPRedH_1615445980) by smtp.aliyun-inc.com(127.0.0.1); Thu, 11 Mar 2021 14:59:45 +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: Assign boolean values to a bool variable Date: Thu, 11 Mar 2021 14:59:39 +0800 Message-Id: <1615445979-52513-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:2041: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: - Make code simpler. 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 b5c2d8b..ba6517b 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -2037,9 +2037,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); } static void ip__resolve_ams(struct thread *thread, -- 1.8.3.1