Skip to content

Commit 1970289

Browse files
tasksetacmel
authored andcommitted
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 <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Julia Lawall <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Wen Yang <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 92151b0 commit 1970289

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/bpf-loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ struct perf_evsel *bpf__setup_output_event(struct perf_evlist *evlist, const cha
16031603

16041604
op = bpf_map__add_newop(map, NULL);
16051605
if (IS_ERR(op))
1606-
return ERR_PTR(PTR_ERR(op));
1606+
return ERR_CAST(op);
16071607
op->op_type = BPF_MAP_OP_SET_EVSEL;
16081608
op->v.evsel = evsel;
16091609
}

0 commit comments

Comments
 (0)