Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp823344pxb; Thu, 28 Jan 2021 00:38:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNHrw9FasGdJcl+0/HP2QCWwyYtUBzJUCtqA8slfdYq1ZOk+bdLP0OCvQ7ztp2demytRih X-Received: by 2002:a17:906:e09:: with SMTP id l9mr10176675eji.196.1611823107721; Thu, 28 Jan 2021 00:38:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611823107; cv=none; d=google.com; s=arc-20160816; b=FWmobui29UhmxPshKyhNn/7QelUhHScnEC7oI8V/YULErhx6bKO/6xftBGtc59FeHP 4+WXZz/jzyIZxp+uYV93eR2cOscNGfV8hhczDZadu/UJMj6eTjgyxb0YDqrYk01Pp5Kx XJSYapVuK8O5kM4MB5rgvQLr2QMyk0ci3LBKslY/leMP/wmUcNbSMJ+eFgt0DdHH/ze6 EG8tQKO5Aw4eDeEpH0Ty0GseuUuFU/RqU2GS534f/4QH+JKjXp5F/i8I15+KuBZ6THhM t2bmyJVO/b4S3FN2PUR8GATwqSAsDYd3Q0sqFuIZZ+bGT4BIcwhr/9yJh0oi/ZL7R9sk Ov5Q== 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=/0TBdpflX59XegBXhMup8Ovm4fC6VnfcENel3kBaT3c=; b=0Cm+2GqhhJDUihMLq8kZF7yGE/RqXqqpvLN+0KoQgSx5oSc+VfYMo17z2MbMaRhGB7 ObAPpTo5aPOtK5W7A9Ump6m15OX1jCqG70stBVrYz+b2yhfwadGttvrbQQk5FUHcRAzk GWdUfBIYzajyE+jJ9OkNavUd5ibxsQe8Orhpm4zAFO7RnsYek7lrR3A2um188EHDfq2U j+C0OjoidthX+lnhwnxEqM6+oQ/1N93vZGO/wSwpCeh8uCciyGqNsPpUu0BVRbnGe9u6 0UJDfKNyi1fA9TJicffCY9NBTb/VD7vcH6rUYqmU5I+0mOHNLQq5JPS1z54/OX5eSAoM WmLA== 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 hh14si2127078ejb.457.2021.01.28.00.38.03; Thu, 28 Jan 2021 00:38:27 -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 S231713AbhA1IhO (ORCPT + 99 others); Thu, 28 Jan 2021 03:37:14 -0500 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:45074 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbhA1Ig2 (ORCPT ); Thu, 28 Jan 2021 03:36:28 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R471e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=abaci-bugfix@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0UN7j3SL_1611822913; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:abaci-bugfix@linux.alibaba.com fp:SMTPD_---0UN7j3SL_1611822913) by smtp.aliyun-inc.com(127.0.0.1); Thu, 28 Jan 2021 16:35:30 +0800 From: Abaci Team 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, Abaci Team Subject: [PATCH] bpf: Simplify bool conversion Date: Thu, 28 Jan 2021 16:35:12 +0800 Message-Id: <1611822912-3746-1-git-send-email-abaci-bugfix@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 warning: ./tools/perf/builtin-script.c:2789:36-41: WARNING: conversion to bool not needed here ./tools/perf/builtin-script.c:3237:48-53: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Suggested-by: Yang Li Signed-off-by: Abaci Team --- tools/perf/builtin-script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 42dad4a..3646a1c 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2786,7 +2786,7 @@ static int parse_output_fields(const struct option *opt __maybe_unused, break; } if (i == imax && strcmp(tok, "flags") == 0) { - print_flags = change == REMOVE ? false : true; + print_flags = change != REMOVE; continue; } if (i == imax) { @@ -3234,7 +3234,7 @@ static char *get_script_path(const char *script_root, const char *suffix) static bool is_top_script(const char *script_path) { - return ends_with(script_path, "top") == NULL ? false : true; + return ends_with(script_path, "top") != NULL; } static int has_required_arg(char *script_path) -- 1.8.3.1