linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: samples: fix the 2 struct_ops definitions
@ 2024-07-05 12:09 Benjamin Tissoires
  2024-07-08  9:24 ` Benjamin Tissoires
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Tissoires @ 2024-07-05 12:09 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: linux-input, linux-kernel, Benjamin Tissoires

Turns out that this is not compiling anymore because the hid_bpf_ops
struct_ops definition had a change during the revisions.

Fixes: e342d6f6f7d8 ("HID: samples: convert the 2 HID-BPF samples into struct_ops")
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
 samples/hid/hid_mouse.bpf.c        | 8 ++++----
 samples/hid/hid_surface_dial.bpf.c | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/samples/hid/hid_mouse.bpf.c b/samples/hid/hid_mouse.bpf.c
index bd901fa855c9..f7f722dcf56d 100644
--- a/samples/hid/hid_mouse.bpf.c
+++ b/samples/hid/hid_mouse.bpf.c
@@ -67,7 +67,7 @@ static int hid_x_event(struct hid_bpf_ctx *hctx)
 	return 0;
 }
 
-SEC("struct_ops/device_event")
+SEC("struct_ops/hid_device_event")
 int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
 {
 	int ret = hid_y_event(hctx);
@@ -79,7 +79,7 @@ int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
 }
 
 
-SEC("struct_ops/rdesc_fixup")
+SEC("struct_ops/hid_rdesc_fixup")
 int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
 {
 	__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
@@ -121,8 +121,8 @@ int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
 
 SEC(".struct_ops.link")
 struct hid_bpf_ops mouse_invert = {
-	.rdesc_fixup = (void *)hid_rdesc_fixup,
-	.device_event = (void *)hid_event,
+	.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
+	.hid_device_event = (void *)hid_event,
 };
 
 char _license[] SEC("license") = "GPL";
diff --git a/samples/hid/hid_surface_dial.bpf.c b/samples/hid/hid_surface_dial.bpf.c
index d8d0fb07391f..527d584812ab 100644
--- a/samples/hid/hid_surface_dial.bpf.c
+++ b/samples/hid/hid_surface_dial.bpf.c
@@ -10,7 +10,7 @@
 #define HID_UP_BUTTON		0x0009
 #define HID_GD_WHEEL		0x0038
 
-SEC("struct_ops/device_event")
+SEC("struct_ops/hid_device_event")
 int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx)
 {
 	__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 9 /* size */);
@@ -101,7 +101,7 @@ int set_haptic(struct haptic_syscall_args *args)
 }
 
 /* Convert REL_DIAL into REL_WHEEL */
-SEC("struct_ops/rdesc_fixup")
+SEC("struct_ops/hid_rdesc_fixup")
 int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
 {
 	__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */);
@@ -132,8 +132,8 @@ int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
 
 SEC(".struct_ops.link")
 struct hid_bpf_ops surface_dial = {
-	.rdesc_fixup = (void *)hid_rdesc_fixup,
-	.device_event = (void *)hid_event,
+	.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
+	.hid_device_event = (void *)hid_event,
 };
 
 char _license[] SEC("license") = "GPL";

---
base-commit: f58e7f404da44c94e46bfe657b8707195aebd25a
change-id: 20240705-for-6-11-bpf-a349efc08df8

Best regards,
-- 
Benjamin Tissoires <bentiss@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: samples: fix the 2 struct_ops definitions
  2024-07-05 12:09 [PATCH] HID: samples: fix the 2 struct_ops definitions Benjamin Tissoires
@ 2024-07-08  9:24 ` Benjamin Tissoires
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Tissoires @ 2024-07-08  9:24 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires; +Cc: linux-input, linux-kernel

On Fri, 05 Jul 2024 14:09:25 +0200, Benjamin Tissoires wrote:
> Turns out that this is not compiling anymore because the hid_bpf_ops
> struct_ops definition had a change during the revisions.
> 
> 

Applied to hid/hid.git (for-6.11/bpf), thanks!

[1/1] HID: samples: fix the 2 struct_ops definitions
      https://git.kernel.org/hid/hid/c/b35e0dc548aa

Cheers,
-- 
Benjamin Tissoires <bentiss@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-08  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-05 12:09 [PATCH] HID: samples: fix the 2 struct_ops definitions Benjamin Tissoires
2024-07-08  9:24 ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).