Skip to content

Commit

Permalink
selftests: hid: enforce new attach API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Tissoires authored and Jiri Kosina committed Jan 18, 2023
1 parent 4b9a3f4 commit 6e021d6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/testing/selftests/hid/hid_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,7 @@ TEST_F(hid_bpf, test_attach_detach)
LOAD_PROGRAMS(progs);

link = self->hid_links[0];
/* we might not be using the new code path where hid_bpf_attach_prog()
* returns a link.
*/
if (!link)
link = bpf_program__fd(self->skel->progs.hid_first_event);
ASSERT_GT(link, 0) TH_LOG("HID-BPF link not created");

/* inject one event */
buf[0] = 1;
Expand Down

0 comments on commit 6e021d6

Please sign in to comment.