Skip to content

Commit

Permalink
perf tools: Fix a compiling error in util/map.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Feng Tang authored and Arnaldo Carvalho de Melo committed Sep 20, 2012
1 parent b1ab1bd commit 8f28f19
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8f28f19

Please sign in to comment.