[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1269636240-8895-1-git-send-email-ddaney@caviumnetworks.com>
Date: Fri, 26 Mar 2010 13:44:00 -0700
From: David Daney <ddaney@...iumnetworks.com>
To: torvalds@...ux-foundation.org, akpm@...ux-foundation.org
Cc: linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
David Daney <ddaney@...iumnetworks.com>
Subject: [PATCH] Protect prefetch macro arguments.
The GCC built-in __builtin_prefetch() is a vargs function. If we
don't wrap the macro parameter in parentheses, a comma operator in the
actual argument list might cause unintended parameters to be passed to
__builtin_prefetch().
Signed-off-by: David Daney <ddaney@...iumnetworks.com>
---
include/linux/prefetch.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
index af7c36a..6179433 100644
--- a/include/linux/prefetch.h
+++ b/include/linux/prefetch.h
@@ -35,11 +35,11 @@
*/
#ifndef ARCH_HAS_PREFETCH
-#define prefetch(x) __builtin_prefetch(x)
+#define prefetch(x) __builtin_prefetch((x))
#endif
#ifndef ARCH_HAS_PREFETCHW
-#define prefetchw(x) __builtin_prefetch(x,1)
+#define prefetchw(x) __builtin_prefetch((x), 1)
#endif
#ifndef ARCH_HAS_SPINLOCK_PREFETCH
--
1.6.6.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists