perf callchains: Fix unw_word_t pointer casts

unw_word_t is uint64_t even on 32-bit MIPS.  Cast it to uintptr_t before
the cast to void *p to get rid of the following errors:

  util/unwind-libunwind.c: In function 'access_mem':
  util/unwind-libunwind.c:464:4: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  util/unwind-libunwind.c:475:2: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  cc1: all warnings being treated as errors
  make[3]: *** [util/unwind-libunwind.o] Error 1

Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabinv@axis.com>
Link: http://lkml.kernel.org/r/1443379079-29133-1-git-send-email-rabin.vincent@axis.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Rabin Vincent 2015-09-27 20:37:55 +02:00 committed by Arnaldo Carvalho de Melo
parent 8eac1d5e92
commit 186c6cfb32

View File

@ -463,7 +463,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
if (ret) { if (ret) {
pr_debug("unwind: access_mem %p not inside range" pr_debug("unwind: access_mem %p not inside range"
" 0x%" PRIx64 "-0x%" PRIx64 "\n", " 0x%" PRIx64 "-0x%" PRIx64 "\n",
(void *) addr, start, end); (void *) (uintptr_t) addr, start, end);
*valp = 0; *valp = 0;
return ret; return ret;
} }
@ -473,7 +473,7 @@ static int access_mem(unw_addr_space_t __maybe_unused as,
offset = addr - start; offset = addr - start;
*valp = *(unw_word_t *)&stack->data[offset]; *valp = *(unw_word_t *)&stack->data[offset];
pr_debug("unwind: access_mem addr %p val %lx, offset %d\n", pr_debug("unwind: access_mem addr %p val %lx, offset %d\n",
(void *) addr, (unsigned long)*valp, offset); (void *) (uintptr_t) addr, (unsigned long)*valp, offset);
return 0; return 0;
} }