]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/hid: fix kfunc inclusions with newer bpftool
authorBenjamin Tissoires <bentiss@kernel.org>
Thu, 28 Nov 2024 13:27:16 +0000 (14:27 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Fri, 29 Nov 2024 14:27:04 +0000 (15:27 +0100)
commit8d355b56f29533e0b0db0d9a2de8bdc05ab27375
treeac033277908c1d3a4fcffc8c4897520f2871fa26
parent0b1b0c112437d7547a6588009e08face31b22c47
selftests/hid: fix kfunc inclusions with newer bpftool

bpftool now embeds the kfuncs definitions directly in the generated
vmlinux.h

This is great, but because the selftests dir might be compiled with
HID_BPF disabled, we have no guarantees to be able to compile the
sources with the generated kfuncs.

If we have the kfuncs, because we have the `__not_used` hack, the newly
defined kfuncs do not match the ones from vmlinux.h and things go wrong.

Prevent vmlinux.h to define its kfuncs and also add the missing `__weak`
symbols for our custom kfuncs definitions

Link: https://patch.msgid.link/20241128-fix-new-bpftool-v1-1-c9abdf94a719@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
tools/testing/selftests/hid/progs/hid_bpf_helpers.h