]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
selftests/hid: fix compilation when bpf_wq and hid_device are not exported
authorBenjamin Tissoires <bentiss@kernel.org>
Fri, 13 Mar 2026 07:40:24 +0000 (08:40 +0100)
committerBenjamin Tissoires <bentiss@kernel.org>
Mon, 16 Mar 2026 15:21:06 +0000 (16:21 +0100)
commit5d4c6c132ea9a967d48890dd03e6a786c060e968
treeda2b51f5ef27b467489570a00820f7ae44344af0
parent0a3fe972a7cb1404f693d6f1711f32bc1d244b1c
selftests/hid: fix compilation when bpf_wq and hid_device are not exported

This can happen in situations when CONFIG_HID_SUPPORT is set to no, or
some complex situations where struct bpf_wq is not exported.

So do the usual dance of hiding them before including vmlinux.h, and
then redefining them and make use of CO-RE to have the correct offsets.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202603111558.KLCIxsZB-lkp@intel.com/
Fixes: fe8d561db3e8 ("selftests/hid: add wq test for hid_bpf_input_report()")
Cc: stable@vger.kernel.org
Acked-by: Jiri Kosina <jkosina@suse.com>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
tools/testing/selftests/hid/progs/hid_bpf_helpers.h