perf config: Refactor the code using 'ret' variable in cmd_config()
authorTaeung Song <treeze.taeung@gmail.com>
Sat, 17 Jun 2017 03:46:42 +0000 (12:46 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 20 Jun 2017 01:05:55 +0000 (22:05 -0300)
commitdfe1c6d7efa8ead6878b73216d4c891a28207528
treecdec6d8a70a4ce696744be2abf8ce04caa2ebcea
parent4f1fd74283582f3f5c34d1c9ed55117d775b4a20
perf config: Refactor the code using 'ret' variable in cmd_config()

To simplify the code related to 'ret' variable in cmd_config(),
initialize 'ret' with -1 instead of 0 and use goto to perform resource
release at the end of the function, setting ret to zero just before the
out_err label, as usual in the kernel sources.

Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1497671202-20495-1-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-config.c