android_kernel_xiaomi_sm7250/arch
Arnd Bergmann 1b84e67496 x86: math-emu: Hide clang warnings for 16-bit overflow
[ Upstream commit 29e7e9664aec17b94a9c8c5a75f8d216a206aa3a ]

clang warns about a few parts of the math-emu implementation
where a 16-bit integer becomes negative during assignment:

arch/x86/math-emu/poly_tan.c:88:35: error: implicit conversion from 'int' to 'short' changes value from 49216 to -16320 [-Werror,-Wconstant-conversion]
                                      (0x41 + EXTENDED_Ebias) | SIGN_Negative);
                                      ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
arch/x86/math-emu/fpu_emu.h:180:58: note: expanded from macro 'setexponent16'
 #define setexponent16(x,y)  { (*(short *)&((x)->exp)) = (y); }
                                                      ~  ^
arch/x86/math-emu/reg_constant.c:37:32: error: implicit conversion from 'int' to 'short' changes value from 49085 to -16451 [-Werror,-Wconstant-conversion]
FPU_REG const CONST_PI2extra = MAKE_REG(NEG, -66,
                               ^~~~~~~~~~~~~~~~~~
arch/x86/math-emu/reg_constant.c:21:25: note: expanded from macro 'MAKE_REG'
                ((EXTENDED_Ebias+(e)) | ((SIGN_##s != 0)*0x8000)) }
                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/math-emu/reg_constant.c:48:28: error: implicit conversion from 'int' to 'short' changes value from 65535 to -1 [-Werror,-Wconstant-conversion]
FPU_REG const CONST_QNaN = MAKE_REG(NEG, EXP_OVER, 0x00000000, 0xC0000000);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/math-emu/reg_constant.c:21:25: note: expanded from macro 'MAKE_REG'
                ((EXTENDED_Ebias+(e)) | ((SIGN_##s != 0)*0x8000)) }
                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

The code is correct as is, so add a typecast to shut up the warnings.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190712090816.350668-1-arnd@arndb.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-08-06 19:06:51 +02:00
..
alpha
arc ARC: hide unused function unw_hdr_alloc 2019-07-21 09:03:14 +02:00
arm ARM: dts: rockchip: Mark that the rk3288 timer might stop in suspend 2019-08-06 19:06:46 +02:00
arm64 arm64: dts: rockchip: fix isp iommu clocks and power domain 2019-08-06 19:06:47 +02:00
c6x
h8300
hexagon
ia64 ia64: fix build errors by exporting paddr_to_nid() 2019-06-22 08:15:19 +02:00
m68k
microblaze
mips MIPS: lantiq: Fix bitfield masking 2019-08-06 19:06:48 +02:00
nds32
nios2
openrisc
parisc parisc: Fix kernel panic due invalid values in IAOQ0 or IAOQ1 2019-07-26 09:14:29 +02:00
powerpc powerpc/tm: Fix oops on sigreturn on systems without TM 2019-07-31 07:27:11 +02:00
riscv riscv: Fix udelay in RV32. 2019-07-14 08:11:09 +02:00
s390 s390: fix stfle zero padding 2019-07-21 09:03:14 +02:00
sh Fix allyesconfig output. 2019-08-04 09:30:57 +02:00
sparc sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD 2019-06-25 11:35:57 +08:00
um um: Silence lockdep complaint about mmap_sem 2019-07-31 07:27:04 +02:00
unicore32
x86 x86: math-emu: Hide clang warnings for 16-bit overflow 2019-08-06 19:06:51 +02:00
xtensa xtensa: Fix section mismatch between memblock_reserve and mem_reserve 2019-06-25 11:35:56 +08:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00