Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: hid: enforce new attach API

Now that the new API for hid_bpf_attach_prog() is in place, ensure we
get an fd when calling this function. And remove the fallback code.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Benjamin Tissoires and committed by
Jiri Kosina
6e021d64 4b9a3f49

+1 -5
+1 -5
tools/testing/selftests/hid/hid_bpf.c
··· 638 638 LOAD_PROGRAMS(progs); 639 639 640 640 link = self->hid_links[0]; 641 - /* we might not be using the new code path where hid_bpf_attach_prog() 642 - * returns a link. 643 - */ 644 - if (!link) 645 - link = bpf_program__fd(self->skel->progs.hid_first_event); 641 + ASSERT_GT(link, 0) TH_LOG("HID-BPF link not created"); 646 642 647 643 /* inject one event */ 648 644 buf[0] = 1;