Skip to content

Commit 6e021d6

Browse files
bentissJiri Kosina
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4b9a3f4 commit 6e021d6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/testing/selftests/hid/hid_bpf.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,7 @@ TEST_F(hid_bpf, test_attach_detach)
638638
LOAD_PROGRAMS(progs);
639639

640640
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");
646642

647643
/* inject one event */
648644
buf[0] = 1;

0 commit comments

Comments
 (0)