[PATCH] bpf: btf: make alloc_obj_fields array const
From: Bradley Morgan
Date: Sun Sep 06 2026 - 18:39:13 EST
The alloc_obj_fields array is never modified. Make the array itself
const, not just the strings it points to.
Signed-off-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>
---
kernel/bpf/btf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 91b8ce77f699..d23282e218b0 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -5766,7 +5766,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env)
return btf_check_sec_info(env, btf_data_size);
}
-static const char *alloc_obj_fields[] = {
+static const char * const alloc_obj_fields[] = {
"bpf_spin_lock",
"bpf_list_head",
"bpf_list_node",
--
2.47.3