[PATCH sched_ext/for-7.1] tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY()

Kuba Piecuch posted 1 patch 2 months ago
tools/sched_ext/include/scx/common.h | 1 +
1 file changed, 1 insertion(+)
[PATCH sched_ext/for-7.1] tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY()
Posted by Kuba Piecuch 2 months ago
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>
---
 tools/sched_ext/include/scx/common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/sched_ext/include/scx/common.h b/tools/sched_ext/include/scx/common.h
index 823251fc47151..60f5513787d66 100644
--- a/tools/sched_ext/include/scx/common.h
+++ b/tools/sched_ext/include/scx/common.h
@@ -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)
 
-- 
2.53.0.1213.gd9a14994de-goog
Re: [PATCH sched_ext/for-7.1] tools/sched_ext: Add explicit cast from void* in RESIZE_ARRAY()
Posted by Tejun Heo 2 months ago
Hello,

> Kuba Piecuch (1): tools/sched_ext: Add explicit cast from void* in
>  RESIZE_ARRAY()

Applied to sched_ext/for-7.1.

Thanks.
--
tejun