diff options
author | Feng Tang <feng.tang@intel.com> | 2012-08-27 15:38:26 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-09-20 08:36:34 -0300 |
commit | 8f28f19a87cb48d13570ba774a3e85776eb36bb4 (patch) | |
tree | 7dc643cce7503e5eac7667e635147439d65b2de6 /tools | |
parent | b1ab1bd1921536c2a97adb888effeff4370a3246 (diff) |
perf tools: Fix a compiling error in util/map.c
This patch fix a compile warning taken as error:
CC util/map.o
cc1: warnings being treated as errors
util/map.c: In function ‘map__fprintf_dsoname’:
util/map.c:240: error: ‘dsoname’ may be used uninitialized in this function
make: *** [util/map.o] Error 1
Signed-off-by: Feng Tang <feng.tang@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1346053107-11946-3-git-send-email-feng.tang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/map.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index b442ee49452b..ead5316b3f89 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c @@ -243,15 +243,14 @@ size_t map__fprintf(struct map *self, FILE *fp) size_t map__fprintf_dsoname(struct map *map, FILE *fp) { - const char *dsoname; + const char *dsoname = "[unknown]"; if (map && map->dso && (map->dso->name || map->dso->long_name)) { if (symbol_conf.show_kernel_path && map->dso->long_name) dsoname = map->dso->long_name; else if (map->dso->name) dsoname = map->dso->name; - } else - dsoname = "[unknown]"; + } return fprintf(fp, "%s", dsoname); } |