Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp120362pxf; Wed, 10 Mar 2021 01:57:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4uVV5YhMV3OHevYGHCldKrjGCpr4OnHKB4lfdyU/N3obw7yItpwXCWHSE7rYX6evhSKY6 X-Received: by 2002:a17:906:6bd1:: with SMTP id t17mr1316879ejs.319.1615370246306; Wed, 10 Mar 2021 01:57:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615370246; cv=none; d=google.com; s=arc-20160816; b=z2G+2XUQ3eYG26ip5r4vQXNJQLQmUlqSdyOuBrVfqdvOEgSL+RtV533VKEuvtbojiW gij2WIuidf3nhHQXnv/qdCDoe+QFOGVtQO/gt/7Tgkp/sBYQbv+gimCBz4LuIpEx+G8L bVxkM9SBnQTiwsXcr5XNhvK9KRmhkcuLqvTixQjLR3qSRVCEdik8C1iagz2cvVE1yACk jtp2FZ52KyfS+2xjwfYgoiF9aKwXRS23dfTlTpoWfJBq2FZs0+C1ElbIiGAOwOTr7uN7 EaKtJ77c9zZv9NJ8BQDLX4WGHPL0MtwbsgmhRC9DGmLxVN4V0Rhj59WdOOJo/cT9uYYQ 6g3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=vTJTQ7RexcrfwdMhZ6nFBJDHsHY41aK8F87EPRhEEzE=; b=vwU0S7Nz5W/XAYzUxlk0xsW0KQrgpw+djIvugbrHHragTvjUExaWpjfH7ORV4j8msj y9BTwL4w6WeIzY2FUjdjs6PmalFeCt379l0KD2ruTOCRHThzFxodyWWZoRS0TkQsRC/J 4hRFw8X10BvyE8nyhySLPsHCfTuqZUv1FA+IMhwv9tpeYTKY5rrUl7UbeivIeb9niupS m3JFyLQVrv7zn0V4lXsFKpyYeOYri6Hf8jyVdGs4z+s3q88YkCUiHUtL/fn0O6MnzZMU jt/h8I3DKHQqSyfO8m4KAUOJAQdzSPiAbEua/DpFofGkyYmPsC+Ktc8qKVTIdTjom3LK uPzA== 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=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv19si10732801ejc.109.2021.03.10.01.57.04; Wed, 10 Mar 2021 01:57:26 -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=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231539AbhCJJ4I convert rfc822-to-8bit (ORCPT + 99 others); Wed, 10 Mar 2021 04:56:08 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:39164 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbhCJJzp (ORCPT ); Wed, 10 Mar 2021 04:55:45 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-196-icghlii5Ppe-aK3eY6X3oQ-1; Wed, 10 Mar 2021 09:55:39 +0000 X-MC-Unique: icghlii5Ppe-aK3eY6X3oQ-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 10 Mar 2021 09:55:39 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 10 Mar 2021 09:55:39 +0000 From: David Laight To: 'Jiapeng Chong' , "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" Subject: RE: [PATCH] perf machine: Assign boolean values to a bool variable Thread-Topic: [PATCH] perf machine: Assign boolean values to a bool variable Thread-Index: AQHXFMyuUkzqglnwCE+oJIwnabqrBap8/PsQ Date: Wed, 10 Mar 2021 09:55:39 +0000 Message-ID: References: <1615284669-82139-1-git-send-email-jiapeng.chong@linux.alibaba.com> In-Reply-To: <1615284669-82139-1-git-send-email-jiapeng.chong@linux.alibaba.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiapeng Chong > Sent: 09 March 2021 10:11 > > 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 > --- > tools/perf/util/machine.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c > index b5c2d8b..435771e 100644 > --- a/tools/perf/util/machine.c > +++ b/tools/perf/util/machine.c > @@ -2038,8 +2038,8 @@ 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 true; > + return false; What's wrong with: return !regexec(regex, sym->name, 0, NULL, 0); David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)