2017-11-23 07:33:42

by Nick Desaulniers

[permalink] [raw]
Subject: constant conversion warning in umip

Pulling down ToT, I'm seeing the following warning when building with clang:

CC arch/x86/lib/insn.o
arch/x86/lib/insn-eval.c:780:10: error: implicit conversion from 'int'
to 'char' changes value from 132 to -124
[-Werror,-Wconstant-conversion]
return INSN_CODE_SEG_PARAMS(4, 8);
~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/insn-eval.h:16:57: note: expanded from macro
'INSN_CODE_SEG_PARAMS'
#define INSN_CODE_SEG_PARAMS(oper_sz, addr_sz) (oper_sz | (addr_sz << 4))
~~~~~~~~^~~~~~~~~~~~~~~~

seems to be coming from commit 4efea85fb56fa "x86/insn-eval: Add
function to get default params of code segment". Should this be an
unsigned char (as well as seg_defs in arch/x86/kernel/umip.c? That
might be an issue for returning -EINVAL, maybe an in/out parameter
would be better?

From 1584847669165191397@xxx Thu Nov 23 09:15:17 +0000 2017
X-GM-THRID: 1584080649720877136
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread