Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: e342d6f6f7d8 ("HID: samples: convert the 2 HID-BPF samples into struct_ops")
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

+8 -8
+4 -4
samples/hid/hid_mouse.bpf.c
··· 67 67 return 0; 68 68 } 69 69 70 - SEC("struct_ops/device_event") 70 + SEC("struct_ops/hid_device_event") 71 71 int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx, enum hid_report_type type) 72 72 { 73 73 int ret = hid_y_event(hctx); ··· 79 79 } 80 80 81 81 82 - SEC("struct_ops/rdesc_fixup") 82 + SEC("struct_ops/hid_rdesc_fixup") 83 83 int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx) 84 84 { 85 85 __u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */); ··· 121 121 122 122 SEC(".struct_ops.link") 123 123 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, 126 126 }; 127 127 128 128 char _license[] SEC("license") = "GPL";
+4 -4
samples/hid/hid_surface_dial.bpf.c
··· 10 10 #define HID_UP_BUTTON 0x0009 11 11 #define HID_GD_WHEEL 0x0038 12 12 13 - SEC("struct_ops/device_event") 13 + SEC("struct_ops/hid_device_event") 14 14 int BPF_PROG(hid_event, struct hid_bpf_ctx *hctx) 15 15 { 16 16 __u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 9 /* size */); ··· 101 101 } 102 102 103 103 /* Convert REL_DIAL into REL_WHEEL */ 104 - SEC("struct_ops/rdesc_fixup") 104 + SEC("struct_ops/hid_rdesc_fixup") 105 105 int BPF_PROG(hid_rdesc_fixup, struct hid_bpf_ctx *hctx) 106 106 { 107 107 __u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 4096 /* size */); ··· 132 132 133 133 SEC(".struct_ops.link") 134 134 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, 137 137 }; 138 138 139 139 char _license[] SEC("license") = "GPL";