From: Arnaldo Carvalho de Melo Date: Tue, 17 May 2022 00:18:11 +0000 (-0300) Subject: perf bench breakpoint: Fix build on 32-bit arches X-Git-Tag: v6.6.17~7455^2~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df36d2572e0515dc190459489c159b78bb3a21fc;p=platform%2Fkernel%2Flinux-rpi.git perf bench breakpoint: Fix build on 32-bit arches Cast pointers to unsigned long instead of to uint64_t to avoid this problem on 32-bit arches: 31 6.89 debian:experimental-x-mips : FAIL gcc version 11.2.0 (Debian 11.2.0-18) bench/breakpoint.c: In function 'breakpoint_setup': bench/breakpoint.c:56:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] 56 | attr.bp_addr = (uint64_t)addr; | ^ cc1: all warnings being treated as errors make[3]: *** [/git/perf-5.18.0-rc7/tools/build/Makefile.build:139: bench] Error 2 Fixes: 68a6772f11dbb1ed ("perf bench: Add breakpoint benchmarks") Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Dmitriy Vyukov Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/YoLq1nHx1doi+VWl@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/bench/breakpoint.c b/tools/perf/bench/breakpoint.c index 2f30a4d..41385f8 100644 --- a/tools/perf/bench/breakpoint.c +++ b/tools/perf/bench/breakpoint.c @@ -53,7 +53,7 @@ static int breakpoint_setup(void *addr) attr.inherit = 1; attr.exclude_kernel = 1; attr.exclude_hv = 1; - attr.bp_addr = (uint64_t)addr; + attr.bp_addr = (unsigned long)addr; attr.bp_type = HW_BREAKPOINT_RW; attr.bp_len = HW_BREAKPOINT_LEN_1; return syscall(SYS_perf_event_open, &attr, 0, -1, -1, 0);