summaryrefslogtreecommitdiffstats
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2020-11-23 23:19:03 +0100
committerBorislav Petkov <bp@suse.de>2021-03-15 13:03:46 +0100
commitf935178b5c1c32ff803b15892a8ba85a1280cb01 (patch)
tree8091de53fad64e10fe6b35123b7e718227027895 /arch/x86/lib
parent404b639e510b36136ef15b08ca8a022845ed87db (diff)
downloadlinux-f935178b5c1c32ff803b15892a8ba85a1280cb01.tar.gz
linux-f935178b5c1c32ff803b15892a8ba85a1280cb01.tar.bz2
linux-f935178b5c1c32ff803b15892a8ba85a1280cb01.zip
x86/insn: Make insn_complete() static
... 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
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/insn.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index bb58004497f8..058f19b20465 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -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