lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181127090610.28488-1-wen.yang99@zte.com.cn>
Date:   Tue, 27 Nov 2018 17:06:10 +0800
From:   Wen Yang <wen.yang99@....com.cn>
To:     alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org
Cc:     peterz@...radead.org, acme@...nel.org,
        linux-kernel@...r.kernel.org, zhong.weidong@....com.cn,
        Wen Yang <wen.yang99@....com.cn>,
        Julia Lawall <julia.lawall@...6.fr>,
        Wen Yang <yellowriver2010@...mail.com>
Subject: [PATCH] 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 <wen.yang99@....com.cn>
CC: Peter Zijlstra <peterz@...radead.org>
CC: Arnaldo Carvalho de Melo <acme@...nel.org>
CC: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
CC: Jiri Olsa <jolsa@...hat.com>
CC: Namhyung Kim <namhyung@...nel.org>
CC: Julia Lawall <julia.lawall@...6.fr>
CC: Wen Yang <yellowriver2010@...mail.com>
CC: linux-kernel@...r.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_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;
 		}
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ