x86/insn: Make insn_complete() static
authorBorislav Petkov <bp@suse.de>
Mon, 23 Nov 2020 22:19:03 +0000 (23:19 +0100)
committerBorislav Petkov <bp@suse.de>
Mon, 15 Mar 2021 12:03:46 +0000 (13:03 +0100)
... and move it above the only place it is used.

Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210304174237.31945-22-bp@alien8.de
arch/x86/include/asm/insn.h
arch/x86/lib/insn.c
tools/arch/x86/include/asm/insn.h
tools/arch/x86/lib/insn.c

index 5eb3753dce33ad7367b988743b707cbad86aa61d..f03b6ca7dec6c416ef5c8651efb08ab8d3ca2e42 100644 (file)
@@ -178,13 +178,6 @@ static inline int insn_has_emulate_prefix(struct insn *insn)
        return !!insn->emulate_prefix_size;
 }
 
-/* Ensure this instruction is decoded completely */
-static inline int insn_complete(struct insn *insn)
-{
-       return insn->opcode.got && insn->modrm.got && insn->sib.got &&
-               insn->displacement.got && insn->immediate.got;
-}
-
 static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
 {
        if (insn->vex_prefix.nbytes == 2)       /* 2 bytes VEX */
index bb58004497f8312e55da608ec654a89a7239b2df..058f19b20465f7b084cefcaa020518c4a433eaac 100644 (file)
@@ -714,6 +714,13 @@ int insn_get_length(struct insn *insn)
        return 0;
 }
 
+/* Ensure this instruction is decoded completely */
+static inline int insn_complete(struct insn *insn)
+{
+       return insn->opcode.got && insn->modrm.got && insn->sib.got &&
+               insn->displacement.got && insn->immediate.got;
+}
+
 /**
  * insn_decode() - Decode an x86 instruction
  * @insn:      &struct insn to be initialized
index 5aae785003dc1f3b8e6a2ed7664ed2abbfd9853d..c9f3eeebb53be6f0e57ae61a5d64c086055be012 100644 (file)
@@ -178,13 +178,6 @@ static inline int insn_has_emulate_prefix(struct insn *insn)
        return !!insn->emulate_prefix_size;
 }
 
-/* Ensure this instruction is decoded completely */
-static inline int insn_complete(struct insn *insn)
-{
-       return insn->opcode.got && insn->modrm.got && insn->sib.got &&
-               insn->displacement.got && insn->immediate.got;
-}
-
 static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
 {
        if (insn->vex_prefix.nbytes == 2)       /* 2 bytes VEX */
index be2b057f91d4f614a63430ece2a897218eb4b13a..cd4dedde3265a63dd5bb2b7634c626f164c87b33 100644 (file)
@@ -714,6 +714,13 @@ int insn_get_length(struct insn *insn)
        return 0;
 }
 
+/* Ensure this instruction is decoded completely */
+static inline int insn_complete(struct insn *insn)
+{
+       return insn->opcode.got && insn->modrm.got && insn->sib.got &&
+               insn->displacement.got && insn->immediate.got;
+}
+
 /**
  * insn_decode() - Decode an x86 instruction
  * @insn:      &struct insn to be initialized