From: Arnaldo Carvalho de Melo Date: Mon, 23 Apr 2018 19:43:47 +0000 (-0300) Subject: perf symbols: Use __map__is_kernel() instead of ad-hoc equivalent code X-Git-Tag: microblaze-v4.18-rc3~107^2~17^2~43 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=efdd5c6b81185223e07452a2f8b5467f81b13d96;p=linux-2.6-microblaze.git perf symbols: Use __map__is_kernel() instead of ad-hoc equivalent code Shorter, should be equivalent code, use it. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-q90olng8sfkvrnsrwu7xnul6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 1466814ebada..2b6292cff719 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c @@ -1163,7 +1163,6 @@ static int dso__load_kcore(struct dso *dso, struct map *map, const char *kallsyms_filename) { struct map_groups *kmaps = map__kmaps(map); - struct machine *machine; struct kcore_mapfn_data md; struct map *old_map, *new_map, *replacement_map = NULL; bool is_64_bit; @@ -1174,10 +1173,8 @@ static int dso__load_kcore(struct dso *dso, struct map *map, if (!kmaps) return -EINVAL; - machine = kmaps->machine; - /* This function requires that the map is the kernel map */ - if (map != machine->vmlinux_maps[map->type]) + if (!__map__is_kernel(map)) return -EINVAL; if (!filename_from_kallsyms_filename(kcore_filename, "kcore",