Commit 62ef449b authored by Feng Yang's avatar Feng Yang Committed by Alexei Starovoitov
Browse files

bpf: Clean up individual BTF_ID code



Use BTF_ID_LIST_SINGLE(a, b, c) instead of
BTF_ID_LIST(a)
BTF_ID(b, c)

Signed-off-by: default avatarFeng Yang <yangfeng@kylinos.cn>
Link: https://lore.kernel.org/r/20250710055419.70544-1-yangfeng59949@163.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 1f489662
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -6200,8 +6200,7 @@ int get_kern_ctx_btf_id(struct bpf_verifier_log *log, enum bpf_prog_type prog_ty
	return kctx_type_id;
}

BTF_ID_LIST(bpf_ctx_convert_btf_id)
BTF_ID(struct, bpf_ctx_convert)
BTF_ID_LIST_SINGLE(bpf_ctx_convert_btf_id, struct, bpf_ctx_convert)

static struct btf *btf_parse_base(struct btf_verifier_env *env, const char *name,
				  void *data, unsigned int data_size)
+1 −2
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ static const struct seq_operations bpf_link_seq_ops = {
	.show	= bpf_link_seq_show,
};

BTF_ID_LIST(btf_bpf_link_id)
BTF_ID(struct, bpf_link)
BTF_ID_LIST_SINGLE(btf_bpf_link_id, struct, bpf_link)

static const struct bpf_iter_seq_info bpf_link_seq_info = {
	.seq_ops		= &bpf_link_seq_ops,
+1 −2
Original line number Diff line number Diff line
@@ -78,8 +78,7 @@ static const struct seq_operations bpf_prog_seq_ops = {
	.show	= bpf_prog_seq_show,
};

BTF_ID_LIST(btf_bpf_prog_id)
BTF_ID(struct, bpf_prog)
BTF_ID_LIST_SINGLE(btf_bpf_prog_id, struct, bpf_prog)

static const struct bpf_iter_seq_info bpf_prog_seq_info = {
	.seq_ops		= &bpf_prog_seq_ops,
+1 −2
Original line number Diff line number Diff line
@@ -829,8 +829,7 @@ static struct bpf_iter_reg ksym_iter_reg_info = {
	.seq_info		= &ksym_iter_seq_info,
};

BTF_ID_LIST(btf_ksym_iter_id)
BTF_ID(struct, kallsym_iter)
BTF_ID_LIST_SINGLE(btf_ksym_iter_id, struct, kallsym_iter)

static int __init bpf_ksym_iter_register(void)
{
+1 −2
Original line number Diff line number Diff line
@@ -781,8 +781,7 @@ BPF_CALL_1(bpf_task_pt_regs, struct task_struct *, task)
	return (unsigned long) task_pt_regs(task);
}

BTF_ID_LIST(bpf_task_pt_regs_ids)
BTF_ID(struct, pt_regs)
BTF_ID_LIST_SINGLE(bpf_task_pt_regs_ids, struct, pt_regs)

const struct bpf_func_proto bpf_task_pt_regs_proto = {
	.func		= bpf_task_pt_regs,
Loading