lkml.org 
[lkml]   [2023]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH HID for-next v2 7/9] selftests: hid: enforce new attach API
Date
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>

---

no changes in v2
---
tools/testing/selftests/hid/hid_bpf.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tools/testing/selftests/hid/hid_bpf.c b/tools/testing/selftests/hid/hid_bpf.c
index 9a262fe99b32..2cf96f818f25 100644
--- a/tools/testing/selftests/hid/hid_bpf.c
+++ b/tools/testing/selftests/hid/hid_bpf.c
@@ -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;
--
2.38.1
\
 
 \ /
  Last update: 2023-03-26 23:39    [W:0.098 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site