[PATCH 1/3] btf_encoder: move btf_encoder__add_decl_tag()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It will need to be above btf_encoder__add_datasec for upcoming changes.
No functional changes.

Signed-off-by: Stephen Brennan <stephen.s.brennan@xxxxxxxxxx>
---
 btf_encoder.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/btf_encoder.c b/btf_encoder.c
index 511c1ea..6a1f5c2 100644
--- a/btf_encoder.c
+++ b/btf_encoder.c
@@ -827,6 +827,27 @@ static int32_t btf_encoder__add_var(struct btf_encoder *encoder, uint32_t type,
 	return id;
 }
 
+static int32_t btf_encoder__add_decl_tag(struct btf_encoder *encoder, const char *value, uint32_t type,
+					 int component_idx)
+{
+	struct btf *btf = encoder->btf;
+	const struct btf_type *t;
+	int32_t id;
+
+	id = btf__add_decl_tag(btf, value, type, component_idx);
+	if (id > 0) {
+		t = btf__type_by_id(btf, id);
+		btf_encoder__log_type(encoder, t, false, true, "type_id=%u component_idx=%d",
+				      t->type, component_idx);
+	} else {
+		btf__log_err(btf, BTF_KIND_DECL_TAG, value, true, id,
+			     "component_idx=%d Error emitting BTF type",
+			     component_idx);
+	}
+
+	return id;
+}
+
 static int32_t btf_encoder__add_var_secinfo(struct btf_encoder *encoder, size_t shndx,
 					    uint32_t type, uint32_t offset, uint32_t size)
 {
@@ -883,27 +904,6 @@ static int32_t btf_encoder__add_datasec(struct btf_encoder *encoder, size_t shnd
 	return id;
 }
 
-static int32_t btf_encoder__add_decl_tag(struct btf_encoder *encoder, const char *value, uint32_t type,
-					 int component_idx)
-{
-	struct btf *btf = encoder->btf;
-	const struct btf_type *t;
-	int32_t id;
-
-	id = btf__add_decl_tag(btf, value, type, component_idx);
-	if (id > 0) {
-		t = btf__type_by_id(btf, id);
-		btf_encoder__log_type(encoder, t, false, true, "type_id=%u component_idx=%d",
-				      t->type, component_idx);
-	} else {
-		btf__log_err(btf, BTF_KIND_DECL_TAG, value, true, id,
-			     "component_idx=%d Error emitting BTF type",
-			     component_idx);
-	}
-
-	return id;
-}
-
 static void btf_encoder__log_func_skip(struct btf_encoder *encoder, struct elf_function *func,
 				       const char *fmt, ...)
 {
-- 
2.43.5





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux