selftests: hid: prepare tests for HID_BPF API change
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Fri, 13 Jan 2023 09:09:31 +0000 (10:09 +0100)
committerJiri Kosina <jkosina@suse.cz>
Wed, 18 Jan 2023 21:08:38 +0000 (22:08 +0100)
commit2574917a2b48f87bd45f1c3e6d80c976f4fe3c3d
treec081acdd5c2d21eee73b1f684379367f179f83df
parentd9db1bb55f1032020328ede7a88b2490574646d3
selftests: hid: prepare tests for HID_BPF API change

We plan on changing the return value of hid_bpf_attach_prog().
Instead of returning an error code, it will return an fd to a bpf_link.
This bpf_link is responsible for the binding between the bpf program and
the hid device.

Add a fallback mechanism to not break bisections by pinning the program
when we run this test against the non changed kernel.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
tools/testing/selftests/hid/hid_bpf.c