bpf: btf: make alloc_obj_fields array const
PATCH 1/1 bpf: btf: make alloc_obj_fields array const
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 <[email protected]>
--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
@@ -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" ,
Signature · 1 line
2.47.3
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 7 lines · On Sun, 6 Sep 2026 22:33:58 +0000 you wrote:
The
alloc_obj_fieldsarray is never modified. Make the array itself const, not just the strings it points to.Signed-off-by Bradley Morgan <[email protected]>--- kernel/bpf/btf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- bpf: btf: make alloc_obj_fields array const
https://git.kernel.org/bpf/bpf-next/c/c1ff425d625e
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html