@@ -7,7 +7,7 @@
#include <linux/bpf.h>
#include <linux/btf.h>
-static struct bpf_struct_ops bpf_bpf_dummy_ops;
+static const struct bpf_struct_ops bpf_bpf_dummy_ops;
/* A common type for test_N with return value in bpf_dummy_ops */
typedef int (*dummy_ops_test_ret_fn)(struct bpf_dummy_ops_state *state, ...);
@@ -297,13 +297,13 @@ static int bpf_dummy_test_sleepable(struct bpf_dummy_ops_state *cb)
return 0;
}
-static struct bpf_dummy_ops __bpf_bpf_dummy_ops = {
+static const struct bpf_dummy_ops __bpf_bpf_dummy_ops = {
.test_1 = bpf_dummy_ops__test_1,
.test_2 = bpf_dummy_test_2,
.test_sleepable = bpf_dummy_test_sleepable,
};
-static struct bpf_struct_ops bpf_bpf_dummy_ops = {
+static const struct bpf_struct_ops bpf_bpf_dummy_ops = {
.verifier_ops = &bpf_dummy_verifier_ops,
.init = bpf_dummy_init,
.check_member = bpf_dummy_ops_check_member,
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> --- net/bpf/bpf_dummy_struct_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)