linux/arch/arm/include/asm
Thomas Gleixner 8101b5a153 ARM: futex: Address build warning
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
2020-05-07 00:41:47 +02:00
..
hardware ARM: l2c: add definition for FWA in PL310 aux register 2019-10-17 16:36:10 +02:00
mach
vdso arm: vdso: Enable arm to use common headers 2020-03-21 15:24:03 +01:00
xen xen: fixes and cleanups for 5.4-rc2 2019-10-04 11:13:09 -07:00
arch_gicv3.h arm: Remove GICv3 vgic compatibility macros 2020-03-24 10:56:05 +00:00
arch_timer.h
arm-cci.h
asm-offsets.h
assembler.h
atomic.h
auxvec.h
barrier.h
bitops.h
bitrev.h
bL_switcher.h
bug.h
bugs.h
cache.h
cacheflush.h
cachetype.h
checksum.h
clocksource.h arm: Introduce asm/vdso/clocksource.h 2020-03-21 15:23:54 +01:00
cmpxchg.h
compiler.h
cp15.h arm: vdso: Enable arm to use common headers 2020-03-21 15:24:03 +01:00
cpu.h
cpufeature.h
cpuidle.h
cputype.h
cti.h
dcc.h
delay.h
device.h
div64.h
dma-contiguous.h
dma-direct.h dma-direct: unify the dma_capable definitions 2019-11-20 20:31:40 +01:00
dma-iommu.h ARM/dma-mapping: merge __dma_supported into arm_dma_supported 2020-03-20 11:43:21 +01:00
dma-mapping.h
dma.h
dmi.h
domain.h ARM: 8908/1: add __always_inline to functions called from __get_user_check() 2019-10-10 22:23:19 +01:00
ecard.h
edac.h
efi.h efi/libstub: Rename efi_call_early/_runtime macros to be more intuitive 2019-12-25 10:49:25 +01:00
elf.h
entry-macro-multi.S
exception.h
fb.h
fiq.h
firmware.h
fixmap.h
floppy.h floppy: separate the FDC's base address from its registers 2020-03-16 08:26:58 -06:00
fncpy.h
fpstate.h
ftrace.h ARM: 8940/1: ftrace: remove mcount(),ftrace_caller_old() and ftrace_call_old() 2019-11-22 00:19:16 +00:00
futex.h ARM: futex: Address build warning 2020-05-07 00:41:47 +02:00
glue-cache.h
glue-df.h
glue-pf.h
glue-proc.h
glue.h
gpio.h
hardirq.h
highmem.h
hugetlb-3level.h
hugetlb.h
hw_breakpoint.h ARM: 8927/1: ARM/hw_breakpoint: add more ARMv8 debug architecture versions support 2019-11-15 22:21:08 +00:00
hw_irq.h
hwcap.h
hypervisor.h
ide.h
idmap.h
insn.h
io.h remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
irq_work.h
irq.h
irqflags.h
jump_label.h
Kbuild asm-generic: make more kernel-space headers mandatory 2020-04-02 09:35:25 -07:00
kexec.h
kgdb.h
kmap_types.h
kprobes.h
krait-l2-accessors.h
linkage.h
mc146818rtc.h
mcpm.h
mcs_spinlock.h
memblock.h
memory.h
mmu_context.h
mmu.h
module.h arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
mpu.h
mtd-xip.h
neon.h
nwflash.h misc: move FLASH_MINOR into miscdevice.h and fix conflicts 2020-03-18 12:27:04 +01:00
opcodes-sec.h
opcodes-virt.h
opcodes.h
outercache.h
page-nommu.h
page.h mm/vma: define a default value for VM_DATA_DEFAULT_FLAGS 2020-04-10 15:36:21 -07:00
paravirt.h
patch.h
pci.h ARM: 8911/1: move pcibios_report_status to <asm/pci.h> 2019-10-27 21:14:40 +00:00
percpu.h
perf_event.h
pgalloc.h mm: remove quicklist page table caches 2019-09-24 15:54:09 -07:00
pgtable-2level-hwdef.h
pgtable-2level-types.h
pgtable-2level.h mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
pgtable-3level-hwdef.h
pgtable-3level-types.h
pgtable-3level.h arm: Remove HYP/Stage-2 page-table support 2020-03-24 10:56:05 +00:00
pgtable-hwdef.h
pgtable-nommu.h ARM: 8954/1: NOMMU: remove stubs for swapops 2020-01-25 18:18:29 +00:00
pgtable.h mm/special: create generic fallbacks for pte_special() and pte_mkspecial() 2020-04-10 15:36:21 -07:00
probes.h
proc-fns.h
processor.h arm: vdso: Enable arm to use common headers 2020-03-21 15:24:03 +01:00
procinfo.h
prom.h
psci.h
ptdump.h
ptrace.h
sections.h arm: Remove HYP/Stage-2 page-table support 2020-03-24 10:56:05 +00:00
secure_cntvoff.h
set_memory.h
setup.h
shmparam.h
signal.h
smp_plat.h
smp_scu.h
smp_twd.h
smp.h
sparsemem.h
spinlock_types.h
spinlock.h
stackprotector.h
stacktrace.h
string.h
suspend.h
swab.h
switch_to.h sched/rt, ARM: Use CONFIG_PREEMPTION 2019-12-08 14:37:32 +01:00
sync_bitops.h
syscall.h
system_info.h
system_misc.h
tcm.h
therm.h
thread_info.h arm: Remove TIF_NOHZ 2020-02-14 16:05:33 +01:00
thread_notify.h
timex.h
tlb.h asm-generic/tlb: provide MMU_GATHER_TABLE_FREE 2020-02-04 03:05:26 +00:00
tlbflush.h
tls.h
topology.h arm/topology: Populate arch_scale_thermal_pressure() for ARM platforms 2020-03-06 12:57:19 +01:00
traps.h
uaccess.h ARM: 8908/1: add __always_inline to functions called from __get_user_check() 2019-10-10 22:23:19 +01:00
ucontext.h
unaligned.h
unified.h
unistd.h
unwind.h
uprobes.h
user.h
v7m.h
vdso_datapage.h ARM: 8930/1: Add support for generic vDSO 2019-11-15 22:21:12 +00:00
vdso.h
vermagic.h arch: split MODULE_ARCH_VERMAGIC definitions out to <asm/vermagic.h> 2020-04-23 10:50:26 +09:00
vfp.h
vfpmacros.h
vga.h
virt.h arm: Remove the ability to set HYP vectors outside of the decompressor 2020-03-24 10:56:05 +00:00
vmalloc.h mm/vmalloc: Add empty <asm/vmalloc.h> headers and use them from <linux/vmalloc.h> 2019-12-10 10:12:55 +01:00
word-at-a-time.h
xor.h