android_kernel_xiaomi_sm7250/arch/x86
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
..
boot x86/boot/compressed/64: Do not corrupt EDX on EFER.LME=1 setting 2019-07-10 09:53:46 +02:00
configs
crypto crypto: x86/crct10dif-pcl - fix use via crypto_shash_digest() 2019-05-22 07:37:37 +02:00
entry x86/entry/32: Fix ENDPROC of common_spurious 2019-07-21 09:03:18 +02:00
events perf/x86/amd/uncore: Set the thread mask for F17h L3 PMCs 2019-07-26 09:14:26 +02:00
hyperv x86/hyperv: Prevent potential NULL pointer dereference 2019-04-20 09:15:59 +02:00
ia32 x86/ia32: Fix ia32_restore_sigcontext() AC leak 2019-05-31 06:46:27 -07:00
include x86/apic: Silence -Wtype-limits compiler warnings 2019-08-06 19:06:51 +02:00
kernel x86/apic: Silence -Wtype-limits compiler warnings 2019-08-06 19:06:51 +02:00
kvm x86: kvm: avoid constant-conversion warning 2019-08-06 19:06:50 +02:00
lib x86/insn-eval: Fix use-after-free access to LDT entry 2019-06-11 12:20:52 +02:00
math-emu x86: math-emu: Hide clang warnings for 16-bit overflow 2019-08-06 19:06:51 +02:00
mm x86/mm/KASLR: Compute the size of the vmemmap section properly 2019-06-19 08:18:07 +02:00
net bpf, x64: fix stack layout of JITed bpf code 2019-07-14 08:11:12 +02:00
oprofile
pci x86/PCI: Fix PCI IRQ routing table memory leak 2019-06-15 11:54:07 +02:00
platform x86/cpu: Sanitize FAM6_ATOM naming 2019-05-14 19:17:53 +02:00
power x86/power: Fix 'nosmt' vs hibernation triple fault during resume 2019-06-11 12:20:52 +02:00
purgatory
ras
realmode x86/realmode: Don't leak the trampoline kernel address 2019-05-04 09:20:21 +02:00
tools
um um: Drop own definition of PTRACE_SYSEMU/_SINGLESTEP 2018-11-21 09:19:16 +01:00
video
xen xen/pvh: set xen_domain_type to HVM in xen_pvh_init 2019-05-22 07:37:45 +02:00
.gitignore
Kbuild
Kconfig x86/smp: Enforce CONFIG_HOTPLUG_CPU when SMP=y 2019-04-03 06:26:29 +02:00
Kconfig.cpu
Kconfig.debug
Makefile jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00
Makefile_32.cpu
Makefile.um kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00