From 073a5f69ef19700ad75381e19892c77d7de0c826 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_function() 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 a3330bf..006033c 100644 --- a/btf_loader.c +++ b/btf_loader.c @@ -77,7 +77,7 @@ out_free_parameters: return -ENOMEM; } -static int create_new_function(struct btf_elf *btfe, const struct btf_type *tp, uint32_t id) +static int create_new_function(struct cu *cu, const struct btf_type *tp, uint32_t id) { struct function *func = tag__alloc(sizeof(*func)); @@ -91,7 +91,7 @@ static int create_new_function(struct btf_elf *btfe, const struct btf_type *tp, func->proto.tag.type = tp->type; func->name = tp->name_off; INIT_LIST_HEAD(&func->lexblock.tags); - cu__add_tag_with_id(btfe->priv, &func->proto.tag, id); + cu__add_tag_with_id(cu, &func->proto.tag, id); return 0; } @@ -453,7 +453,7 @@ static int btf_elf__load_types(struct btf_elf *btfe, struct cu *cu) break; case BTF_KIND_FUNC: // BTF_KIND_FUNC corresponding to a defined subprogram. - err = create_new_function(btfe, type_ptr, type_index); + err = create_new_function(cu, type_ptr, type_index); break; case BTF_KIND_FLOAT: err = create_new_float_type(btfe, type_ptr, type_index);