All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Tissoires <benjamin.tissoires@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>,
	Jiri Kosina <jikos@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Tero Kristo <tero.kristo@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: [PATCH HID for-next v2 7/9] selftests: hid: enforce new attach API
Date: Fri, 13 Jan 2023 10:09:33 +0100	[thread overview]
Message-ID: <20230113090935.1763477-8-benjamin.tissoires@redhat.com> (raw)
In-Reply-To: <20230113090935.1763477-1-benjamin.tissoires@redhat.com>

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


  parent reply	other threads:[~2023-01-13  9:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13  9:09 [PATCH HID for-next v2 0/9] HID-BPF LLVM fixes, no more hacks Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 1/9] selftests: hid: add vmtest.sh Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 2/9] selftests: hid: allow to compile hid_bpf with LLVM Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 3/9] selftests: hid: attach/detach 2 bpf programs, not just one Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 4/9] selftests: hid: ensure the program is correctly pinned Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 5/9] selftests: hid: prepare tests for HID_BPF API change Benjamin Tissoires
2023-01-13  9:09 ` [PATCH HID for-next v2 6/9] HID: bpf: rework how programs are attached and stored in the kernel Benjamin Tissoires
2023-01-15 17:59   ` Alexei Starovoitov
2023-01-13  9:09 ` Benjamin Tissoires [this message]
2023-01-13  9:09 ` [PATCH HID for-next v2 8/9] HID: bpf: clean up entrypoint Benjamin Tissoires
2023-01-15 18:00   ` Alexei Starovoitov
2023-01-13  9:09 ` [PATCH HID for-next v2 9/9] HID: bpf: reorder BPF registration Benjamin Tissoires
2023-01-15 18:00   ` Alexei Starovoitov
2023-01-18 21:12 ` [PATCH HID for-next v2 0/9] HID-BPF LLVM fixes, no more hacks Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230113090935.1763477-8-benjamin.tissoires@redhat.com \
    --to=benjamin.tissoires@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tero.kristo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.