diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 15:19:23 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-10 16:51:09 -0300 |
commit | bf4414ae7b86cddca60a5b510954a37d30583a1f (patch) | |
tree | 39f15982d08d925fbb55aaad9ee99570ca0b2119 /tools/perf/util/dso.c | |
parent | 7e155d4d5e2912f75443c18c02dd6f1dbd4eef84 (diff) | |
download | op-kernel-dev-bf4414ae7b86cddca60a5b510954a37d30583a1f.zip op-kernel-dev-bf4414ae7b86cddca60a5b510954a37d30583a1f.tar.gz |
perf symbols: Constify dso->long_name
Same reason as for dso->short_name, it may point to a const string, and
in most places it is treated as const, i.e. it is just accessed for
using its contents as a key or to show it on reports.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-nf7mxf33zt5qw207pbxxryot@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/dso.c')
-rw-r--r-- | tools/perf/util/dso.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/dso.c b/tools/perf/util/dso.c index ecb37d6..2c7e189 100644 --- a/tools/perf/util/dso.c +++ b/tools/perf/util/dso.c @@ -67,7 +67,7 @@ int dso__binary_type_file(struct dso *dso, enum dso_binary_type type, case DSO_BINARY_TYPE__OPENEMBEDDED_DEBUGINFO: { - char *last_slash; + const char *last_slash; size_t len; size_t dir_size; @@ -386,13 +386,13 @@ struct dso *dso__kernel_findnew(struct machine *machine, const char *name, return dso; } -void dso__set_long_name(struct dso *dso, char *name, bool name_allocated) +void dso__set_long_name(struct dso *dso, const char *name, bool name_allocated) { if (name == NULL) return; if (dso->long_name_allocated) - free(dso->long_name); + free((char *)dso->long_name); dso->long_name = name; dso->long_name_len = strlen(name); @@ -414,7 +414,7 @@ void dso__set_short_name(struct dso *dso, const char *name, bool name_allocated) static void dso__set_basename(struct dso *dso) { - dso__set_short_name(dso, basename(dso->long_name), false); + dso__set_short_name(dso, basename((char *)dso->long_name), false); } int dso__name_len(const struct dso *dso) @@ -478,7 +478,7 @@ void dso__delete(struct dso *dso) if (dso->short_name_allocated) free((char *)dso->short_name); if (dso->long_name_allocated) - free(dso->long_name); + free((char *)dso->long_name); dso_cache__free(&dso->cache); dso__free_a2l(dso); free(dso->symsrc_filename); |