[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230106102332.1019632-8-benjamin.tissoires@redhat.com>
Date: Fri, 6 Jan 2023 11:23:30 +0100
From: Benjamin Tissoires <benjamin.tissoires@...hat.com>
To: Greg KH <gregkh@...uxfoundation.org>,
Jiri Kosina <jikos@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: Tero Kristo <tero.kristo@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org,
Benjamin Tissoires <benjamin.tissoires@...hat.com>
Subject: [PATCH HID for-next v1 7/9] 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@...hat.com>
---
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
Powered by blists - more mailing lists