]> git.baikalelectronics.ru Git - kernel.git/commit
[ARM] 5196/1: fix inline asm constraints for preload
authorNicolas Pitre <nico@cam.org>
Tue, 12 Aug 2008 21:10:59 +0000 (22:10 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 16 Aug 2008 08:30:05 +0000 (09:30 +0100)
commit1e9f15d8b77a3c66d5a093f056f65f61652903df
tree6fceacd79c697b8f7ba0db0e275832dedc1e614a
parent0ea04e8c0e3237358be8a33e1df277f3948c8e7e
[ARM] 5196/1: fix inline asm constraints for preload

With gcc 4.3 and later, a pointer that has already been dereferenced is
assumed not to be null since it should have caused a segmentation fault
otherwise, hence any subsequent test against NULL is optimized away.

Current inline asm constraint used in the implementation of prefetch()
makes gcc believe that the pointer is dereferenced even though the PLD
instruction does not load any data and does not cause a segmentation
fault on null pointers, which causes all sorts of interesting results
when reaching the end of a linked lists for example.

Let's use a better constraint to properly represent the actual usage of
the pointer value.

Problem reported by Chris Steel.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/processor.h