Skip to content

Commit a67a1de

Browse files
author
Benjamin Tissoires
committed
HID: samples: fix the 2 struct_ops definitions
Turns out that this is not compiling anymore because the hid_bpf_ops struct_ops definition had a change during the revisions. Fixes: e342d6f ("HID: samples: convert the 2 HID-BPF samples into struct_ops") Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent 3a904d2 commit a67a1de

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

samples/hid/hid_mouse.bpf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int hid_x_event(struct hid_bpf_ctx *hctx)
6767
return 0;
6868
}
6969

70-
SEC("struct_ops/device_event")
70+
SEC("struct_ops/hid_device_event")
7171
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type)
7272
{
7373
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)
7979
}
8080

8181

82-
SEC("struct_ops/rdesc_fixup")
82+
SEC("struct_ops/hid_rdesc_fixup")
8383
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
8484
{
8585
__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)
121121

122122
SEC(".struct_ops.link")
123123
struct hid_bpf_ops mouse_invert = {
124-
.rdesc_fixup = (void *)hid_rdesc_fixup,
125-
.device_event = (void *)hid_event,
124+
.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
125+
.hid_device_event = (void *)hid_event,
126126
};
127127

128128
char _license[] SEC("license") = "GPL";

samples/hid/hid_surface_dial.bpf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define HID_UP_BUTTON 0x0009
1111
#define HID_GD_WHEEL 0x0038
1212

13-
SEC("struct_ops/device_event")
13+
SEC("struct_ops/hid_device_event")
1414
int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx)
1515
{
1616
__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 9 /* size */);
@@ -101,7 +101,7 @@ int set_haptic(struct haptic_syscall_args *args)
101101
}
102102

103103
/* Convert REL_DIAL into REL_WHEEL */
104-
SEC("struct_ops/rdesc_fixup")
104+
SEC("struct_ops/hid_rdesc_fixup")
105105
int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx)
106106
{
107107
__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)
132132

133133
SEC(".struct_ops.link")
134134
struct hid_bpf_ops surface_dial = {
135-
.rdesc_fixup = (void *)hid_rdesc_fixup,
136-
.device_event = (void *)hid_event,
135+
.hid_rdesc_fixup = (void *)hid_rdesc_fixup,
136+
.hid_device_event = (void *)hid_event,
137137
};
138138

139139
char _license[] SEC("license") = "GPL";

0 commit comments

Comments
 (0)