From: Jiri Olsa Date: Tue, 8 Mar 2016 18:42:30 +0000 (+0100) Subject: perf tools: Omit unnecessary cast in perf_pmu__parse_scale X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea8f75f981918c5946fc4029acdc86707fa901c1;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf tools: Omit unnecessary cast in perf_pmu__parse_scale There's no need to use a const char pointer, we can used char pointer from the beginning and omit the unnecessary cast. Reported-by: Ingo Molnar Signed-off-by: Jiri Olsa Cc: David Ahern Cc: H. Peter Anvin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20160308184230.GB7897@krava.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index d8cd038baed2..adef23b1352e 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -98,7 +98,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char * char scale[128]; int fd, ret = -1; char path[PATH_MAX]; - const char *lc; + char *lc; snprintf(path, PATH_MAX, "%s/%s.scale", dir, name); @@ -146,7 +146,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char * /* restore locale */ setlocale(LC_NUMERIC, lc); - free((char *) lc); + free(lc); ret = 0; error: