]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
perf vendor events: Fix error code in json_events()
authorJohn Garry <john.garry@huawei.com>
Thu, 8 Mar 2018 10:58:27 +0000 (18:58 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Mar 2018 16:54:03 +0000 (13:54 -0300)
commit931ef5dc5c18717d24e5b8d8a968e35638508051
treed4ecca283bf4f575301e6a9a6805ceacd1d2b99a
parent4c0ab16052054946b7b28f8b0ceee57c10d64cc7
perf vendor events: Fix error code in json_events()

When EXPECT macro fails an assertion, the error code is not properly set
after the first loop of tokens in function json_events().

This is because err is set to the return value from func function
pointer call, which must be 0 to continue to loop, yet it is not reset
for for each loop. I assume that this was not the intention, so change
the code so err is set appropriately in EXPECT macro itself.

In addition to this, the indention in EXPECT macro is tidied. The
current indention alludes that the 2 statements following the if
statement are in the body, which is not true.

Signed-off-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: William Cohen <wcohen@redhat.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linuxarm@huawei.com
Link: http://lkml.kernel.org/r/1520506716-197429-3-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/pmu-events/jevents.c