HID: bpf: constify hid_ops

The hid_ops struct is never modified. Mark it as const.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20241127-hid-bpf-ops-v1-1-f9e41bfa3afd@weissschuh.net
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
This commit is contained in:
Thomas Weißschuh 2024-11-27 17:41:56 +01:00 committed by Benjamin Tissoires
parent e8f34747bd
commit f9a11da1d9
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
#include <linux/module.h>
#include "hid_bpf_dispatch.h"
struct hid_ops *hid_ops;
const struct hid_ops *hid_ops;
EXPORT_SYMBOL(hid_ops);
u8 *

View File

@ -3064,7 +3064,7 @@ int hid_check_keys_pressed(struct hid_device *hid)
EXPORT_SYMBOL_GPL(hid_check_keys_pressed);
#ifdef CONFIG_HID_BPF
static struct hid_ops __hid_ops = {
static const struct hid_ops __hid_ops = {
.hid_get_report = hid_get_report,
.hid_hw_raw_request = __hid_hw_raw_request,
.hid_hw_output_report = __hid_hw_output_report,

View File

@ -78,7 +78,7 @@ struct hid_ops {
const struct bus_type *bus_type;
};
extern struct hid_ops *hid_ops;
extern const struct hid_ops *hid_ops;
/**
* struct hid_bpf_ops - A BPF struct_ops of callbacks allowing to attach HID-BPF