Commit f9a11da1 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Benjamin Tissoires
Browse files

HID: bpf: constify hid_ops



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

Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20241127-hid-bpf-ops-v1-1-f9e41bfa3afd@weissschuh.net


Signed-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
parent e8f34747
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 *
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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