mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
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:
parent
e8f34747bd
commit
f9a11da1d9
@ -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 *
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user