From: Serge Belyshev Date: Thu, 4 Oct 2007 21:10:04 +0000 (+0200) Subject: Remove unnecessary cast in prefetch() X-Git-Tag: v2.6.23~29 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ecbca8554d0f643351ee07d3284138a5e85ba81;p=pandora-kernel.git Remove unnecessary cast in prefetch() It is ok to call prefetch() function with NULL argument, as specifically commented in include/linux/prefetch.h. But in standard C, it is invalid to dereference NULL pointer (see C99 standard 6.5.3.2 paragraph 4 and note #84). prefetch() has a memory reference for its argument. Newer gcc versions (4.3 and above) will use that to conclude that "x" argument is non-null and thus wreaking havok everywhere prefetch() was inlined. Fixed by removing cast and changing asm constraint. [ It seems in theory gcc 4.2 could miscompile this too; although no cases known. In 2.6.24 we should probably switch to __builtin_prefetch() instead, but this is a simpler fix for now. -- AK ] Signed-off-by: Serge Belyshev Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed