mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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 <mingo@kernel.org> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: David Ahern <dsahern@gmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/20160308184230.GB7897@krava.redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
d7b617f51b
commit
ea8f75f981
1 changed files with 2 additions and 2 deletions
|
@ -98,7 +98,7 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *
|
||||||
char scale[128];
|
char scale[128];
|
||||||
int fd, ret = -1;
|
int fd, ret = -1;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
const char *lc;
|
char *lc;
|
||||||
|
|
||||||
snprintf(path, PATH_MAX, "%s/%s.scale", dir, name);
|
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 */
|
/* restore locale */
|
||||||
setlocale(LC_NUMERIC, lc);
|
setlocale(LC_NUMERIC, lc);
|
||||||
|
|
||||||
free((char *) lc);
|
free(lc);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
error:
|
error:
|
||||||
|
|
Loading…
Reference in a new issue