All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] objtool: Fix clang enum conversion warning
@ 2017-12-26 21:27 Josh Poimboeuf
  2017-12-27  0:35 ` Nick Desaulniers
  2017-12-28 15:37 ` [tip:core/urgent] objtool: Fix Clang " tip-bot for Lukas Bulwahn
  0 siblings, 2 replies; 9+ messages in thread
From: Josh Poimboeuf @ 2017-12-26 21:27 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Lukas Bulwahn, Jiri Slaby, Nick Desaulniers

From: Lukas Bulwahn <lukas.bulwahn@gmail.com>

Fix the following clang enum conversion warning:

  arch/x86/decode.c:141:20: error: implicit conversion from enumeration
  type 'enum op_src_type' to different enumeration
  type 'enum op_dest_type' [-Werror,-Wenum-conversion]

    op->dest.type = OP_SRC_REG;
		  ~ ^~~~~~~~~~

It just happened to work before because OP_SRC_REG and OP_DEST_REG have
the same value.

Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0")
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 tools/objtool/arch/x86/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index 8acfc47af70e..540a209b78ab 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -138,7 +138,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
 			*type = INSN_STACK;
 			op->src.type = OP_SRC_ADD;
 			op->src.reg = op_to_cfi_reg[modrm_reg][rex_r];
-			op->dest.type = OP_SRC_REG;
+			op->dest.type = OP_DEST_REG;
 			op->dest.reg = CFI_SP;
 		}
 		break;
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-12-28 15:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-26 21:27 [PATCH] objtool: Fix clang enum conversion warning Josh Poimboeuf
2017-12-27  0:35 ` Nick Desaulniers
2017-12-27 12:34   ` Lukas Bulwahn
2017-12-27 17:38     ` Josh Poimboeuf
2017-12-28  3:42       ` Nick Desaulniers
2017-12-28  5:12         ` Josh Poimboeuf
2017-12-28 12:09           ` Ingo Molnar
2017-12-28  8:18       ` Lukas Bulwahn
2017-12-28 15:37 ` [tip:core/urgent] objtool: Fix Clang " tip-bot for Lukas Bulwahn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.