[PATCH] x86emul: drop dead conditional from decode

Jan Beulich posted 1 patch 4 days, 6 hours ago
Failed in applying to current master (apply log)
[PATCH] x86emul: drop dead conditional from decode
Posted by Jan Beulich 4 days, 6 hours ago
We know that opcode_table[0x0f] is 0, there's no need to check that. Up
until ab082ffa87d5 ("x86emul: generate and make use of a canonical opcode
representation") or maybe already c4e7a67e3a10 ("x86emul: drop
SrcInvalid") this may have been justified, but it no longer is.

This eliminates a Misra C:2012 rule 2.2 ("There shall be no dead code")
violation.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -1082,7 +1082,7 @@ int x86emul_decode(struct x86_emulate_st
 
     /* Opcode byte(s). */
     d = opcode_table[b];
-    if ( d == 0 && b == 0x0f )
+    if ( b == 0x0f )
     {
         /* Two-byte opcode. */
         b = insn_fetch_type(uint8_t);