Skip to contentSkip to conversation

bpf: btf: make alloc_obj_fields array const

PATCH Applied Bradley Morgan 2 participants 2 messages Sep 6 – Sep 11 BPF

lore
Share & tools
lore
#0 lore raw

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.

---
 kernel/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
index 91b8ce77f699..d23282e218b0 100644
@@ -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
#1 lore raw
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_fields array is never modified. Make the array itself const, not just the strings it points to.

---
 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