linux/arch/arm
Thomas Gleixner 2023963916 ARM: futex: Address build warning
[ Upstream commit 8101b5a153 ]

Stephen reported the following build warning on a ARM multi_v7_defconfig
build with GCC 9.2.1:

kernel/futex.c: In function 'do_futex':
kernel/futex.c:1676:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1676 |   return oldval == cmparg;
      |          ~~~~~~~^~~~~~~~~
kernel/futex.c:1652:6: note: 'oldval' was declared here
 1652 |  int oldval, ret;
      |      ^~~~~~

introduced by commit a08971e948 ("futex: arch_futex_atomic_op_inuser()
calling conventions change").

While that change should not make any difference it confuses GCC which
fails to work out that oldval is not referenced when the return value is
not zero.

GCC fails to properly analyze arch_futex_atomic_op_inuser(). It's not the
early return, the issue is with the assembly macros. GCC fails to detect
that those either set 'ret' to 0 and set oldval or set 'ret' to -EFAULT
which makes oldval uninteresting. The store to the callsite supplied oldval
pointer is conditional on ret == 0.

The straight forward way to solve this is to make the store unconditional.

Aside of addressing the build warning this makes sense anyway because it
removes the conditional from the fastpath. In the error case the stored
value is uninteresting and the extra store does not matter at all.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/87pncao2ph.fsf@nanos.tec.linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-27 17:37:35 +02:00
..
boot ARM: dts: r8a7740: Add missing extal2 to CPG node 2020-05-20 08:18:53 +02:00
common ARM: 8847/1: pm: fix HYP/SVC mode mismatch when MCPM is used 2020-01-27 14:50:28 +01:00
configs ARM: qcom_defconfig: Enable MAILBOX 2020-01-27 14:49:55 +01:00
crypto crypto: arm/crc32 - avoid warning when compiling with Clang 2019-11-20 18:47:11 +01:00
firmware ARM: 32-bit SoC platform updates 2018-08-23 13:44:43 -07:00
include ARM: futex: Address build warning 2020-05-27 17:37:35 +02:00
kernel ARM: 8957/1: VDSO: Match ARMv8 timer in cntvct_functional() 2020-03-20 11:55:59 +01:00
kvm KVM: arm: Don't write junk to CP15 registers on reset 2019-08-29 08:28:48 +02:00
lib ARM: 8958/1: rename missed uaccess .fixup section 2020-03-20 11:55:59 +01:00
mach-actions
mach-alpine
mach-artpec
mach-asm9260
mach-aspeed
mach-at91 ARM: at91: pm: call put_device instead of of_node_put in at91_pm_config_ws 2019-11-20 18:47:23 +01:00
mach-axxia
mach-bcm PCI: controller: Move PCI_DOMAINS selection to arch Kconfig 2018-06-26 15:37:37 -05:00
mach-berlin ARM: berlin: switch to SPDX license identifier 2018-05-24 14:49:09 +08:00
mach-clps711x
mach-cns3xxx ARM: cns3xxx: Fix writing to wrong PCI config registers after alignment 2019-02-06 17:30:11 +01:00
mach-davinci ARM: davinci: dm365: Fix McBSP dma_slave_map entry 2019-11-10 11:27:26 +01:00
mach-digicolor
mach-dove
mach-ebsa110
mach-efm32
mach-ep93xx sound updates for 4.18 2018-06-06 09:08:38 -07:00
mach-exynos ARM: exynos: Fix undefined instruction during Exynos5422 resume 2019-06-15 11:54:10 +02:00
mach-footbridge treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
mach-gemini
mach-highbank
mach-hisi ARM: hisi: handle of_iomap and fix missing of_node_put 2018-07-16 17:36:50 +01:00
mach-imx ARM: imx: provide v7_cpu_resume() only on ARM_CPU_SUSPEND=y 2020-04-29 16:31:31 +02:00
mach-integrator gpio: pl061: handle failed allocations 2019-02-20 10:25:43 +01:00
mach-iop13xx ARM: iop: don't use using 64-bit DMA masks 2019-05-08 07:21:51 +02:00
mach-iop32x ARM: iop32x/n2100: fix PCI IRQ mapping 2019-02-15 08:10:12 +01:00
mach-iop33x
mach-ixp4xx treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
mach-keystone
mach-ks8695 ARM: ks8695: fix section mismatch warning 2019-12-05 09:20:02 +01:00
mach-lpc18xx
mach-lpc32xx
mach-mediatek
mach-meson ARM: meson: merge Kconfig symbol MACH_MESON8B into MACH_MESON8 2018-05-23 10:08:13 -07:00
mach-mmp ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt 2018-12-19 19:19:51 +01:00
mach-moxart
mach-mv78xx0
mach-mvebu ARM: mvebu: convert secondary CPU clock sync to hotplug state 2018-06-27 08:40:29 +02:00
mach-mxs
mach-netx
mach-nomadik
mach-npcm ARM: npcm: Bring back GPIOLIB support 2020-02-19 19:51:56 +01:00
mach-nspire
mach-omap1 ARM: OMAP1/2: fix SoC name printing 2019-12-13 08:52:11 +01:00
mach-omap2 hwrng: omap3-rom - Fix missing clock by probing with device tree 2020-01-27 14:51:20 +01:00
mach-orion5x
mach-oxnas
mach-picoxcell
mach-prima2
mach-pxa ARM: pxa: avoid section mismatch warning 2019-02-12 19:47:09 +01:00
mach-qcom
mach-realview
mach-rockchip ARM: rockchip: Force CONFIG_PM on Rockchip systems 2018-08-24 08:50:23 -07:00
mach-rpc ARM: riscpc: fix lack of keyboard interrupts after irq conversion 2020-01-27 14:50:47 +01:00
mach-s3c24xx ARM: s3c24xx: Fix boolean expressions in osiris_dvs_notify 2019-03-23 20:10:08 +01:00
mach-s3c64xx regulator: gpio: Revert 2018-06-07 14:23:08 +01:00
mach-s5pv210
mach-sa1100 Merge branch 'i2c/for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-06-14 16:21:46 +09:00
mach-shmobile ARM: shmobile: Always enable ARCH_TIMER on SoCs with A7 and/or A15 2018-07-20 13:44:10 +02:00
mach-socfpga PCI: controller: Move PCI_DOMAINS selection to arch Kconfig 2018-06-26 15:37:37 -05:00
mach-spear
mach-sti
mach-stm32 ARM: stm32: use "depends on" instead of "if" after prompt 2020-01-27 14:51:01 +01:00
mach-sunxi ARM: sunxi: Fix CPU powerdown on A83T 2019-11-12 19:20:40 +01:00
mach-tango ARM: tango: Improve ARCH_MULTIPLATFORM compatibility 2019-02-15 08:10:12 +01:00
mach-tegra ARM: tegra: Enable PLLP bypass during Tegra124 LP1 2020-02-11 04:34:07 -08:00
mach-u300
mach-uniphier ARM: uniphier: select RESET_CONTROLLER 2018-07-31 19:04:41 -07:00
mach-ux500
mach-versatile
mach-vexpress ARM: vexpress: Set-up shared OPP table instead of individual for each CPU 2020-01-12 12:17:08 +01:00
mach-vt8500
mach-w90x900
mach-zx
mach-zynq ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up 2019-10-05 13:10:07 +02:00
mm ARM: 8949/1: mm: mark free_memmap as __init 2020-02-14 16:33:26 -05:00
net arm, bpf: Fix bugs with ALU64 {RSH, ARSH} BPF_K shift by 0 2020-04-23 10:30:12 +02:00
nwfpe
oprofile
plat-iop ARM: iop: don't use using 64-bit DMA masks 2019-05-08 07:21:51 +02:00
plat-omap ARM/time: Remove read_boot_clock64() 2018-07-20 00:02:41 +02:00
plat-orion ARM: orion: don't use using 64-bit DMA masks 2019-05-08 07:21:51 +02:00
plat-pxa ARM: pxa: ssp: Fix "WARNING: invalid free of devm_ allocated data" 2020-01-27 14:50:38 +01:00
plat-samsung ARM: samsung: Fix system restart on S3C6410 2019-10-05 13:10:06 +02:00
plat-versatile
probes ARM: 8834/1: Fix: kprobes: optimized kprobes illegal instruction 2019-02-27 10:08:49 +01:00
tools ARM: 8787/1: wire up io_pgetevents syscall 2018-09-19 10:44:11 +01:00
vdso ARM: vdso: Remove dependency with the arch_timer driver internals 2019-05-31 06:46:11 -07:00
vfp ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc 2019-02-20 10:25:37 +01:00
xen xen/efi: Set nonblocking callbacks 2019-10-29 09:19:33 +01:00
Kconfig ARM: 8951/1: Fix Kexec compilation issue. 2020-02-24 08:34:51 +01:00
Kconfig-nommu
Kconfig.debug ARM: debug: enable UART1 for socfpga Cyclone5 2019-12-13 08:52:08 +01:00
Makefile Kbuild updates for v4.19 (2nd) 2018-08-25 13:40:38 -07:00