]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Do parameter validation earlier on fetch_kernel_version()
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jun 2017 15:19:16 +0000 (12:19 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jun 2017 15:19:16 +0000 (12:19 -0300)
commit84219f774d94e0cf7c63e6b5ede1136e22da23f0
treeb3b30db9baa598e8b0444e8b2984a86b9f5d8ea5
parent4a90fe620613623dd6d15701fce521c5b022429e
perf tools: Do parameter validation earlier on fetch_kernel_version()

While trying to reduce util.[ch] I noticed that fetch_kernel_version()
and fetch_ubuntu_kernel_version() do lots of operations only to check if
they are needed, i.e. it checks if the pointer where to return the
kernel version is NULL only after obtaining the kernel version from
/proc/version_signature or by parsing the results from uname().

Do it earlier not to confuse people reading this code in the future :-)

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-i94qwyekk4tzbu0b9ce1r1mz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/util.c