diff mbox series

[bpf-next,8/9] HID: bpf: constify BPF ops

Message ID 20241127-bpf-const-ops-v1-8-a698b8d58680@weissschuh.net (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series bpf: Constify BPF ops | expand

Commit Message

Thomas Weißschuh Nov. 27, 2024, 7:15 p.m. UTC
The BPF core now allows the registration of read-only ops tables,
make use of it.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 drivers/hid/bpf/hid_bpf_struct_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/hid/bpf/hid_bpf_struct_ops.c b/drivers/hid/bpf/hid_bpf_struct_ops.c
index 0e611a9d79d753213abbdf81f7ac0557e50c2ede..2baefb351a01fcb351fd6da8ca72f42d27779df5 100644
--- a/drivers/hid/bpf/hid_bpf_struct_ops.c
+++ b/drivers/hid/bpf/hid_bpf_struct_ops.c
@@ -289,14 +289,14 @@  static int __hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, u64 source)
 	return 0;
 }
 
-static struct hid_bpf_ops __bpf_hid_bpf_ops = {
+static const struct hid_bpf_ops __bpf_hid_bpf_ops = {
 	.hid_device_event = __hid_bpf_device_event,
 	.hid_rdesc_fixup = __hid_bpf_rdesc_fixup,
 	.hid_hw_request = __hid_bpf_hw_request,
 	.hid_hw_output_report = __hid_bpf_hw_output_report,
 };
 
-static struct bpf_struct_ops bpf_hid_bpf_ops = {
+static const struct bpf_struct_ops bpf_hid_bpf_ops = {
 	.verifier_ops = &hid_bpf_verifier_ops,
 	.init = hid_bpf_ops_init,
 	.check_member = hid_bpf_ops_check_member,