Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp677779imu; Tue, 27 Nov 2018 04:52:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/W0bOtOSDQAICNdeGEvRuyBlMUfSdjuJOt8KwRsC79vU+xVIgNpzDeTxjVY36txqyK34k5t X-Received: by 2002:a17:902:4025:: with SMTP id b34mr32511609pld.181.1543323121276; Tue, 27 Nov 2018 04:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543323121; cv=none; d=google.com; s=arc-20160816; b=Z0oJMwTq4X5h9AKZyHFfZNfm/5IqpVH+nFfs2Jt4GOT9a4n/QRKqiVMHoGw9EqJO1+ d6wWktyeLgDQCpJqyTtMob33QshT134GRUPyqy31p7z37DlVOKuFQNf3VwC6v2hpXT8z X5A86zC8kIWC3TWsTafTeyZJhfi2CW3Yti3t14RFtxI6B0TnkqVrP+66Bm0GgWUtQ0fN 7yTOy4loxusxo2Cic/EcwqVw8neYrq00uP4JzZukNcD+CGNiP1yx04d6RKfqf+bRtkXb 7MVTqqkFdWT2DHfqCEZzlGPQbK5wKNKWnwqM5gri5Vbnq4suToXDRqtswvb1r4xdfTQb OFdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=8Jg2rSPsNVEvTaSA6r12IkxgrdyQWsG+6qwEZ87KTMc=; b=PLVGbjPuf8+rvdMye0q4GhKlWOSfKK79x3uD1kAikeoxFbSUz2Nytu4jX2sigplhGN y4DrYr1DPGv+CaFzJvtt+kZTyZjo4PgcqaF0nGONItQIEZ84YxeOUFTyE35FhD0JDye+ c9sXkNR8EV3TG8EjSgzD0wf3GPm0W4YL8n1c+I7MK7ydw87JCF3V2auFWbgeLPUTNABI KKoVuDSzgPDfpCFV6iTqsCh2DEISgtid6VUWPNTHFwwlTtSjeKKFp3u5hyn2YOkar/w+ I2yjayXdsB2pjDTOtIviZ009Qc2SMTYzyyChatVX2RijS4mv8vGmSsuighwB+kT4q7av +DtA== 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 h32si3690967pgh.276.2018.11.27.04.51.45; Tue, 27 Nov 2018 04:52:01 -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 S1729854AbeK0UEH (ORCPT + 99 others); Tue, 27 Nov 2018 15:04:07 -0500 Received: from out1.zte.com.cn ([202.103.147.172]:33514 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729726AbeK0UEG (ORCPT ); Tue, 27 Nov 2018 15:04:06 -0500 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id A9525B0475D02DCC9178; Tue, 27 Nov 2018 17:06:24 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id wAR96Ebx025384; Tue, 27 Nov 2018 17:06:14 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from LIN-A6CB96A0603.zte.intra ([10.90.106.118]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2018112717062860-13256242 ; Tue, 27 Nov 2018 17:06:28 +0800 From: Wen Yang To: alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org Cc: peterz@infradead.org, acme@kernel.org, linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, Wen Yang , Julia Lawall , Wen Yang Subject: [PATCH] perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Date: Tue, 27 Nov 2018 17:06:10 +0800 Message-Id: <20181127090610.28488-1-wen.yang99@zte.com.cn> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2018-11-27 17:06:28, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2018-11-27 17:06:09 Content-Transfer-Encoding: quoted-printable X-MAIL: mse01.zte.com.cn wAR96Ebx025384 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ERR=5FCAST inlined function instead of ERR=5FPTR(PTR=5FERR(...)). This makes it more readable and also fix this warning detected by err=5Fcast.cocci: tools/perf/util/bpf-loader.c:1606:11-18: WARNING: ERR=5FCAST can be used wi= th op Signed-off-by: Wen Yang CC: Peter Zijlstra CC: Arnaldo Carvalho de Melo CC: Alexander Shishkin CC: Jiri Olsa CC: Namhyung Kim CC: Julia Lawall CC: Wen Yang CC: linux-kernel@vger.kernel.org --- 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=5Fevsel *bpf=5F=5Fsetup=5Foutput=5Fevent(= struct perf=5Fevlist *evlist, const cha =20 op =3D bpf=5Fmap=5F=5Fadd=5Fnewop(map, NULL); if (IS=5FERR(op)) - return ERR=5FPTR(PTR=5FERR(op)); + return ERR=5FCAST(op); op->op=5Ftype =3D BPF=5FMAP=5FOP=5FSET=5FEVSEL; op->v.evsel =3D evsel; } --=20 2.19.1