From 224df412c95bf4ac95200b6af44927ad2ef2abac Mon Sep 17 00:00:00 2001
From: liqiang <liqiang64@huawei.com>
Date: Thu, 29 Aug 2024 03:56:58 +0800
Subject: [PATCH] fix some clean code problem

Signed-off-by: liqiang <liqiang64@huawei.com>
---
 upatch-diff/insn/asm/inat.h | 8 ++++----
 upatch-diff/insn/inat.c     | 6 +++---
 upatch-diff/insn/insn.c     | 6 +++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/upatch-diff/insn/asm/inat.h b/upatch-diff/insn/asm/inat.h
index f446ad8..4ab84d6 100644
--- a/upatch-diff/insn/asm/inat.h
+++ b/upatch-diff/insn/asm/inat.h
@@ -156,7 +156,7 @@ static inline int inat_is_escape(insn_attr_t attr)
 	return attr & INAT_ESC_MASK;
 }
 
-static inline int inat_escape_id(insn_attr_t attr)
+static inline unsigned int inat_escape_id(insn_attr_t attr)
 {
 	return (attr & INAT_ESC_MASK) >> INAT_ESC_OFFS;
 }
@@ -166,7 +166,7 @@ static inline int inat_is_group(insn_attr_t attr)
 	return attr & INAT_GRP_MASK;
 }
 
-static inline int inat_group_id(insn_attr_t attr)
+static inline unsigned int inat_group_id(insn_attr_t attr)
 {
 	return (attr & INAT_GRP_MASK) >> INAT_GRP_OFFS;
 }
@@ -181,7 +181,7 @@ static inline int inat_has_immediate(insn_attr_t attr)
 	return attr & INAT_IMM_MASK;
 }
 
-static inline int inat_immediate_size(insn_attr_t attr)
+static inline unsigned int inat_immediate_size(insn_attr_t attr)
 {
 	return (attr & INAT_IMM_MASK) >> INAT_IMM_OFFS;
 }
@@ -220,4 +220,4 @@ static inline int inat_must_vex(insn_attr_t attr)
 {
 	return attr & INAT_VEXONLY;
 }
-#endif
\ No newline at end of file
+#endif
diff --git a/upatch-diff/insn/inat.c b/upatch-diff/insn/inat.c
index 193583f..cb5aec6 100644
--- a/upatch-diff/insn/inat.c
+++ b/upatch-diff/insn/inat.c
@@ -43,7 +43,7 @@ insn_attr_t inat_get_escape_attribute(insn_byte_t opcode, int lpfx_id,
 				      insn_attr_t esc_attr)
 {
 	const insn_attr_t *table;
-	int n;
+	unsigned int n;
 
 	n = inat_escape_id(esc_attr);
 
@@ -62,7 +62,7 @@ insn_attr_t inat_get_group_attribute(insn_byte_t modrm, int lpfx_id,
 				     insn_attr_t grp_attr)
 {
 	const insn_attr_t *table;
-	int n;
+	unsigned int n;
 
 	n = inat_group_id(grp_attr);
 
@@ -95,4 +95,4 @@ insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
 			return 0;
 	}
 	return table[opcode];
-}
\ No newline at end of file
+}
diff --git a/upatch-diff/insn/insn.c b/upatch-diff/insn/insn.c
index d9a356b..7880eed 100644
--- a/upatch-diff/insn/insn.c
+++ b/upatch-diff/insn/insn.c
@@ -574,6 +574,6 @@ void insn_get_length(struct insn *insn)
 		return;
 	if (!insn->immediate.got)
 		insn_get_immediate(insn);
-	insn->length = (unsigned char)((unsigned long)insn->next_byte
-				     - (unsigned long)insn->kaddr);
-}
\ No newline at end of file
+	insn->length = (unsigned char)((unsigned long)insn->next_byte -
+				       (unsigned long)insn->kaddr);
+}
-- 
2.34.1

