[PATCH] compiler.h: Move __memory_barrier() use to compiler-intel.h

From: Pranith Kumar
Date: Mon Aug 11 2014 - 18:51:30 EST


Commit 73679e5082012 ("compiler-intel.h: Remove duplicate definition") removed a
duplicate definition of barrier() from compiler-intel.h. This is the wrong
duplicate definition removed since __memory_barrier() is an intel compiler
specific intrinsic and should live in compiler-intel.h.

This commit reverts the previous commit and removes the definition from
compiler.h

Signed-off-by: Pranith Kumar <bobby.prani@xxxxxxxxx>
---
include/linux/compiler-intel.h | 3 +++
include/linux/compiler.h | 5 -----
2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index ba147a1..5529c52 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -13,9 +13,12 @@
/* Intel ECC compiler doesn't support gcc specific asm stmts.
* It uses intrinsics to do the equivalent things.
*/
+#undef barrier
#undef RELOC_HIDE
#undef OPTIMIZER_HIDE_VAR

+#define barrier() __memory_barrier()
+
#define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
__ptr = (unsigned long) (ptr); \
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index d5ad7b1..bc24cad 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -160,11 +160,6 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
# define unlikely(x) __builtin_expect(!!(x), 0)
#endif

-/* Optimization barrier */
-#ifndef barrier
-# define barrier() __memory_barrier()
-#endif
-
/* Unreachable code */
#ifndef unreachable
# define unreachable() do { } while (1)
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/