perf auxtrace arm: Fixing uninitialised variable
authorMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 12 Feb 2018 20:32:37 +0000 (13:32 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 16 Feb 2018 17:55:40 +0000 (14:55 -0300)
When working natively on arm64 the compiler gets pesky and complains
that variable 'i' is uninitialised, something that breaks the
compilation.  Here no further checks are needed since variable
'found_spe' can only be true if variable 'i' has been initialised as
part of the for loop.

Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/1518467557-18505-4-git-send-email-mathieu.poirier@linaro.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/arch/arm/util/auxtrace.c

index 2323581b157d7e8f643a8709cd648bf9997e0d10..fa639e3e52acb37b13dd63920eb963f509c9431b 100644 (file)
@@ -68,7 +68,7 @@ struct auxtrace_record
        bool found_spe = false;
        static struct perf_pmu **arm_spe_pmus = NULL;
        static int nr_spes = 0;
-       int i;
+       int i = 0;
 
        if (!evlist)
                return NULL;