perf mmap: Add new return value logic for perf_mmap__read_init()
authorKan Liang <kan.liang@intel.com>
Thu, 18 Jan 2018 21:26:20 +0000 (13:26 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 15 Feb 2018 12:52:49 +0000 (09:52 -0300)
commit189f2cc91f9f2efef5d5f4dde43684c01b5f6f2f
treed24142a151f26c2bb5ee24bbe51a355253e73159
parent8872481bd04850b19e053dc579de5a11b83b16fc
perf mmap: Add new return value logic for perf_mmap__read_init()

Improve the readability by using meaningful enum (-EAGAIN, -EINVAL and
0) to replace the three returning states (0, -1 and 1).

Suggested-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Kan Liang <kan.liang@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1516310792-208685-6-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/mmap.c