From dd3e9ab4a00f8cf900a68dfd2c2749f19edf273b Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Wed, 2 Jun 2021 13:04:48 -0300 Subject: [PATCH] btf_loader: Move create_new_forward_decl() from btfe to cu As all it needs is btfe->priv that is cu. Signed-off-by: Arnaldo Carvalho de Melo --- btf_loader.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/btf_loader.c b/btf_loader.c index ff504c3..e8a6cf7 100644 --- a/btf_loader.c +++ b/btf_loader.c @@ -324,14 +324,14 @@ static int create_new_subroutine_type(struct cu *cu, const struct btf_type *tp, return cu__load_ftype(cu, proto, DW_TAG_subroutine_type, tp, id); } -static int create_new_forward_decl(struct btf_elf *btfe, const struct btf_type *tp, uint32_t id) +static int create_new_forward_decl(struct cu *cu, const struct btf_type *tp, uint32_t id) { struct class *fwd = class__new(tp->name_off, 0, btf_kflag(tp)); if (fwd == NULL) return -ENOMEM; fwd->type.declaration = 1; - cu__add_tag_with_id(btfe->priv, &fwd->type.namespace.tag, id); + cu__add_tag_with_id(cu, &fwd->type.namespace.tag, id); return 0; } @@ -424,7 +424,7 @@ static int btf_elf__load_types(struct btf_elf *btfe, struct cu *cu) err = create_new_enumeration(cu, type_ptr, type_index); break; case BTF_KIND_FWD: - err = create_new_forward_decl(btfe, type_ptr, type_index); + err = create_new_forward_decl(cu, type_ptr, type_index); break; case BTF_KIND_TYPEDEF: err = create_new_typedef(btfe, type_ptr, type_index);