summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/sched_ext/maybe_null.bpf.c
diff options
context:
space:
mode:
authorVishal Chourasia <vishalc@linux.ibm.com>2024-10-24 10:46:09 +0530
committerTejun Heo <tj@kernel.org>2024-10-24 06:56:17 -1000
commit4f7f417042b242c1e5a9ed03741acb5d900e0871 (patch)
tree3328ec0000163779f05b60d2c097efc6517dce68 /tools/testing/selftests/sched_ext/maybe_null.bpf.c
parent9b3c11a867a82ebee4e096008014417918b82801 (diff)
sched_ext: Fix function pointer type mismatches in BPF selftests
Fix incompatible function pointer type warnings in sched_ext BPF selftests by explicitly casting the function pointers when initializing struct_ops. This addresses multiple -Wincompatible-function-pointer-types warnings from the clang compiler where function signatures didn't match exactly. The void * cast ensures the compiler accepts the function pointer assignment despite minor type differences in the parameters. Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/testing/selftests/sched_ext/maybe_null.bpf.c')
-rw-r--r--tools/testing/selftests/sched_ext/maybe_null.bpf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/sched_ext/maybe_null.bpf.c b/tools/testing/selftests/sched_ext/maybe_null.bpf.c
index 27d0f386acfb..cf4ae870cd4e 100644
--- a/tools/testing/selftests/sched_ext/maybe_null.bpf.c
+++ b/tools/testing/selftests/sched_ext/maybe_null.bpf.c
@@ -29,8 +29,8 @@ bool BPF_STRUCT_OPS(maybe_null_success_yield, struct task_struct *from,
SEC(".struct_ops.link")
struct sched_ext_ops maybe_null_success = {
- .dispatch = maybe_null_success_dispatch,
- .yield = maybe_null_success_yield,
- .enable = maybe_null_running,
+ .dispatch = (void *) maybe_null_success_dispatch,
+ .yield = (void *) maybe_null_success_yield,
+ .enable = (void *) maybe_null_running,
.name = "minimal",
};