Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Prepare to reuse get_ctx_arg_idx

Rename get_ctx_arg_idx to bpf_ctx_arg_idx, and allow others to call it.
No functional change.

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://patch.msgid.link/20250409214606.2000194-2-ameryhung@gmail.com

authored by

Amery Hung and committed by
Martin KaFai Lau
a1b669ea ab734b43

+4 -3
+1
include/linux/btf.h
··· 522 522 const char *suffix); 523 523 int btf_ctx_arg_offset(const struct btf *btf, const struct btf_type *func_proto, 524 524 u32 arg_no); 525 + u32 btf_ctx_arg_idx(struct btf *btf, const struct btf_type *func_proto, int off); 525 526 526 527 struct bpf_verifier_log; 527 528
+3 -3
kernel/bpf/btf.c
··· 6391 6391 return btf_type_is_int(t); 6392 6392 } 6393 6393 6394 - static u32 get_ctx_arg_idx(struct btf *btf, const struct btf_type *func_proto, 6395 - int off) 6394 + u32 btf_ctx_arg_idx(struct btf *btf, const struct btf_type *func_proto, 6395 + int off) 6396 6396 { 6397 6397 const struct btf_param *args; 6398 6398 const struct btf_type *t; ··· 6671 6671 tname, off); 6672 6672 return false; 6673 6673 } 6674 - arg = get_ctx_arg_idx(btf, t, off); 6674 + arg = btf_ctx_arg_idx(btf, t, off); 6675 6675 args = (const struct btf_param *)(t + 1); 6676 6676 /* if (t == NULL) Fall back to default BPF prog with 6677 6677 * MAX_BPF_FUNC_REG_ARGS u64 arguments.