From 509439572e9cfae4b4483f46669b2a6566dceb35 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 18 Nov 2024 12:35:30 +0100 Subject: [PATCH] lsfd-cmd: make pointer arrays const --- lsfd-cmd/cdev.c | 2 +- lsfd-cmd/unkn.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lsfd-cmd/cdev.c b/lsfd-cmd/cdev.c index 2bb7b7465..3319479ae 100644 --- a/lsfd-cmd/cdev.c +++ b/lsfd-cmd/cdev.c @@ -649,7 +649,7 @@ static struct cdev_ops cdev_tty_ops = { .get_ipc_class = cdev_tty_get_ipc_class, }; -static const struct cdev_ops *cdev_ops[] = { +static const struct cdev_ops *const cdev_ops[] = { &cdev_tun_ops, &cdev_misc_ops, &cdev_tty_ops, diff --git a/lsfd-cmd/unkn.c b/lsfd-cmd/unkn.c index 5338d8cec..b1883bf34 100644 --- a/lsfd-cmd/unkn.c +++ b/lsfd-cmd/unkn.c @@ -939,7 +939,7 @@ static const struct anon_ops anon_inotify_ops = { * Generally, we use "-" as the word separators in lsfd's output. * However, about bpf*, we use "_" because bpftool uses "_". */ -static const char *bpf_prog_type_table[] = { +static const char *const bpf_prog_type_table[] = { [0] = "unspec", /* BPF_PROG_TYPE_UNSPEC*/ [1] = "socket_filter", /* BPF_PROG_TYPE_SOCKET_FILTER*/ [2] = "kprobe", /* BPF_PROG_TYPE_KPROBE*/ @@ -1139,7 +1139,7 @@ static const struct anon_ops anon_bpf_prog_ops = { /* * bpf-map */ -static const char *bpf_map_type_table[] = { +static const char *const bpf_map_type_table[] = { [0] = "unspec", /* BPF_MAP_TYPE_UNSPEC */ [1] = "hash", /* BPF_MAP_TYPE_HASH */ [2] = "array", /* BPF_MAP_TYPE_ARRAY */ @@ -1332,7 +1332,7 @@ static const struct anon_ops anon_generic_ops = { .handle_fdinfo = NULL, }; -static const struct anon_ops *anon_ops[] = { +static const struct anon_ops *const anon_ops[] = { &anon_pidfd_ops, &anon_eventfd_ops, &anon_eventpoll_ops, -- 2.47.3