| From bc010dd657ee0309276c88ab828b9ad156f75b31 Mon Sep 17 00:00:00 2001 |
| From: Leo Yan <leo.yan@linaro.org> |
| Date: Wed, 19 Feb 2020 10:18:11 +0800 |
| Subject: [PATCH 5/5] perf cs-etm: Fix unsigned variable comparison to zero |
| |
| The variable 'offset' in function cs_etm__sample() is u64 type, it's not |
| appropriate to check it with 'while (offset > 0)'; this patch changes to |
| 'while (offset)'. |
| |
| Signed-off-by: Leo Yan <leo.yan@linaro.org> |
| Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> |
| Reviewed-by: Mike Leach <mike.leach@linaro.org> |
| Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> |
| Cc: Jiri Olsa <jolsa@redhat.com> |
| Cc: Mark Rutland <mark.rutland@arm.com> |
| Cc: Namhyung Kim <namhyung@kernel.org> |
| Cc: Peter Zijlstra <peterz@infradead.org> |
| Cc: Robert Walker <robert.walker@arm.com> |
| Cc: Suzuki Poulouse <suzuki.poulose@arm.com> |
| Cc: coresight ml <coresight@lists.linaro.org> |
| Cc: linux-arm-kernel@lists.infradead.org |
| Link: http://lore.kernel.org/lkml/20200219021811.20067-6-leo.yan@linaro.org |
| Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
| --- |
| tools/perf/util/cs-etm.c | 2 +- |
| 1 file changed, 1 insertion(+), 1 deletion(-) |
| |
| diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c |
| index 87d9943177bc..62d2f9b9ce1b 100644 |
| --- a/tools/perf/util/cs-etm.c |
| +++ b/tools/perf/util/cs-etm.c |
| @@ -962,7 +962,7 @@ static inline u64 cs_etm__instr_addr(struct cs_etm_queue *etmq, |
| if (packet->isa == CS_ETM_ISA_T32) { |
| u64 addr = packet->start_addr; |
| |
| - while (offset > 0) { |
| + while (offset) { |
| addr += cs_etm__t32_instr_size(etmq, |
| trace_chan_id, addr); |
| offset--; |
| -- |
| 2.32.0.272.g935e593368-goog |
| |