]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/hid: fix bpf_wq new API
authorBenjamin Tissoires <bentiss@kernel.org>
Tue, 23 Jul 2024 16:21:51 +0000 (18:21 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Wed, 24 Jul 2024 16:27:21 +0000 (18:27 +0200)
Since commit f56f4d541eab ("bpf: helpers: fix bpf_wq_set_callback_impl
signature"), the API for bpf_wq changed a bit.

We need to update the selftests/hid code to reflect that or the
bpf program will not load.

Link: https://patch.msgid.link/20240723-fix-6-11-bpf-v1-1-b9d770346784@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
tools/testing/selftests/hid/progs/hid.c
tools/testing/selftests/hid/progs/hid_bpf_helpers.h

index ee9bbbcf751b4871796518c6545faac6de603575..5ecc845ef79216d42e141e42167289109ea79267 100644 (file)
@@ -455,7 +455,7 @@ struct {
        __type(value, struct elem);
 } hmap SEC(".maps");
 
-static int wq_cb_sleepable(void *map, int *key, struct bpf_wq *work)
+static int wq_cb_sleepable(void *map, int *key, void *work)
 {
        __u8 buf[9] = {2, 3, 4, 5, 6, 7, 8, 9, 10};
        struct hid_bpf_ctx *hid_ctx;
index cfe37f4919062271bc3a85c16d9b68fdc0d4f474..e5db897586bbfe010d8799f6f52fc5c418344e6b 100644 (file)
@@ -114,7 +114,7 @@ extern int hid_bpf_try_input_report(struct hid_bpf_ctx *ctx,
 extern int bpf_wq_init(struct bpf_wq *wq, void *p__map, unsigned int flags) __weak __ksym;
 extern int bpf_wq_start(struct bpf_wq *wq, unsigned int flags) __weak __ksym;
 extern int bpf_wq_set_callback_impl(struct bpf_wq *wq,
-               int (callback_fn)(void *map, int *key, struct bpf_wq *wq),
+               int (callback_fn)(void *map, int *key, void *wq),
                unsigned int flags__k, void *aux__ign) __ksym;
 #define bpf_wq_set_callback(timer, cb, flags) \
        bpf_wq_set_callback_impl(timer, cb, flags, NULL)