]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY()
authorKuba Piecuch <jpiecuch@google.com>
Mon, 13 Apr 2026 15:50:05 +0000 (15:50 +0000)
committerTejun Heo <tj@kernel.org>
Mon, 13 Apr 2026 16:14:11 +0000 (06:14 -1000)
This fixes the following compilation error when using the header from
C++ code:

  error: assigning to 'struct scx_flux__data_uei_dump *' from
  incompatible type 'void *'

Signed-off-by: Kuba Piecuch <jpiecuch@google.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/include/scx/common.h

index 823251fc4715139fd1795b5bd4bc2621499a38aa..60f5513787d66c8414bf5a9a6bf9ec25460139be 100644 (file)
@@ -67,6 +67,7 @@ typedef int64_t s64;
                bpf_map__set_value_size((__skel)->maps.elfsec##_##arr,                  \
                                sizeof((__skel)->elfsec##_##arr->arr[0]) * (n));        \
                (__skel)->elfsec##_##arr =                                              \
+                       (typeof((__skel)->elfsec##_##arr))                              \
                        bpf_map__initial_value((__skel)->maps.elfsec##_##arr, &__sz);   \
        } while (0)