Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3888005imu; Tue, 18 Dec 2018 05:56:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/WRbdkglY4fEE1L4eP3ZhAPLmyvbybkrLTHFA6rnaqpaDFeFQMSVhGPpSWcLWEaHNq6LfuO X-Received: by 2002:a63:2744:: with SMTP id n65mr15726282pgn.65.1545141416493; Tue, 18 Dec 2018 05:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545141416; cv=none; d=google.com; s=arc-20160816; b=QFMnNUmYe6hnzQe1I1gPRKkJS5rexNjr1fBn8TsGjWbGuSr0/gKHgZ8XrYBvcejkih BDIG8QsFbYwRo9rvT6nobRJmqfz3Aq/h7pwIXFwGkkf1XLpmfeIKvYe06qqfG5rNI1oB DgeAvG6M3v3HJHUjhA1SuHmk1rnQ4l2p5SYpam/fNPxHu5M2I9uY00ZMKcqz2lOELD6H SEXi2r2hvkacgYBKzIdB0nEA/aEdemhyGPXV2DPi1udh7Y5tXj9q7DqZZGVNCmEES5yS f9zTU1rgWdBcwhTDd1QUE7s50qzWtkljqU0F6SirtDYieVjQjPC2B4Z4i/N7jCLOM+um 4lAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=s7gE+m2rxEhJs0qD65bcUt4pveSmHvmvZwEwnc9xsoU=; b=iDuraDj/AatHqZ6sFXAWi3Xe71jK13KSnPfHho3x2kG8NZegxLU1+aDje/O9jZthZd uI8gz72IaZtKHq/Z39Fao9KJU2cBg1kphYzBzurOkbLc/CfXKU+JEEPTl7onHEOvwWvO 17kYnS9UfuGnzIpsm1LbHbwfSDIYtxYWP465WNv9Jfotvqw1Ewa3TskdE6U8KeJmL5DT j1mdycETv9AMpAvAT3XLoQqxLobotWG+er1YsFdllbY8xe0m5vcVx6wDgUn+881t7evO WiMeBYjA6BOtZS2BFSWY290Xv/24HlXaP3XDmbbwqWjA2FoT5YmSJGBP+rKIGaFjBjKh fAeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i13si13441564pgi.260.2018.12.18.05.56.41; Tue, 18 Dec 2018 05:56:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbeLRNx7 (ORCPT + 99 others); Tue, 18 Dec 2018 08:53:59 -0500 Received: from terminus.zytor.com ([198.137.202.136]:38269 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbeLRNx6 (ORCPT ); Tue, 18 Dec 2018 08:53:58 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wBIDrYTq2851112 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Dec 2018 05:53:34 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wBIDrYt82851109; Tue, 18 Dec 2018 05:53:34 -0800 Date: Tue, 18 Dec 2018 05:53:34 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Wen Yang Message-ID: Cc: peterz@infradead.org, hpa@zytor.com, yellowriver2010@hotmail.com, linux-kernel@vger.kernel.org, mingo@kernel.org, jolsa@redhat.com, tglx@linutronix.de, julia.lawall@lip6.fr, alexander.shishkin@linux.intel.com, namhyung@kernel.org, acme@redhat.com, wen.yang99@zte.com.cn Reply-To: wen.yang99@zte.com.cn, acme@redhat.com, namhyung@kernel.org, alexander.shishkin@linux.intel.com, julia.lawall@lip6.fr, tglx@linutronix.de, jolsa@redhat.com, mingo@kernel.org, yellowriver2010@hotmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org In-Reply-To: <20181127090610.28488-1-wen.yang99@zte.com.cn> References: <20181127090610.28488-1-wen.yang99@zte.com.cn> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Git-Commit-ID: 19702894cd93d79c5b5a63f56f6f417595b1a57c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, FREEMAIL_FORGED_REPLYTO,FREEMAIL_REPLYTO_END_DIGIT, T_DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 19702894cd93d79c5b5a63f56f6f417595b1a57c Gitweb: https://git.kernel.org/tip/19702894cd93d79c5b5a63f56f6f417595b1a57c Author: Wen Yang AuthorDate: Tue, 27 Nov 2018 17:06:10 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 17 Dec 2018 14:54:36 -0300 perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)). This makes it more readable and also fix this warning detected by err_cast.cocci: tools/perf/util/bpf-loader.c:1606:11-18: WARNING: ERR_CAST can be used with op Signed-off-by: Wen Yang Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Julia Lawall Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wen Yang Cc: zhong.weidong@zte.com.cn Link: http://lkml.kernel.org/r/20181127090610.28488-1-wen.yang99@zte.com.cn Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c index f9ae1a993806..9a280647d829 100644 --- a/tools/perf/util/bpf-loader.c +++ b/tools/perf/util/bpf-loader.c @@ -1603,7 +1603,7 @@ struct perf_evsel *bpf__setup_output_event(struct perf_evlist *evlist, const cha op = bpf_map__add_newop(map, NULL); if (IS_ERR(op)) - return ERR_PTR(PTR_ERR(op)); + return ERR_CAST(op); op->op_type = BPF_MAP_OP_SET_EVSEL; op->v.evsel = evsel; }