perf genelf: Fix NO_LIBDW=1 build
authorIan Rogers <irogers@google.com>
Wed, 2 Jul 2025 17:54:02 +0000 (10:54 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 3 Jul 2025 02:01:54 +0000 (19:01 -0700)
With NO_LIBDW=1 a new unused-parameter warning/error has appeared:
```
util/genelf.c: In function ‘jit_write_elf’:
util/genelf.c:163:32: error: unused parameter ‘load_addr’ [-Werror=unused-parameter]
  163 | jit_write_elf(int fd, uint64_t load_addr, const char *sym,
```

Fixes: e3f612c1d8f3 ("perf genelf: Remove libcrypto dependency and use built-in sha1()")
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20250702175402.761818-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/genelf.c

index fcf86a27f69e1a72ce4efd662233dde07e62e4d2..591548b10e34ef6ae5db59ff5452587dfbaa7689 100644 (file)
@@ -160,7 +160,7 @@ jit_add_eh_frame_info(Elf *e, void* unwinding, uint64_t unwinding_header_size,
  * csize: the code size in bytes
  */
 int
-jit_write_elf(int fd, uint64_t load_addr, const char *sym,
+jit_write_elf(int fd, uint64_t load_addr __maybe_unused, const char *sym,
              const void *code, int csize,
              void *debug __maybe_unused, int nr_debug_entries __maybe_unused,
              void *unwinding, uint64_t unwinding_header_size, uint64_t unwinding_size)