]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/compiler.h
arm/arm64: smccc: Implement SMCCC v1.1 inline primitive
[mirror_ubuntu-artful-kernel.git] / include / linux / compiler.h
index eca8ad75e28b054db4657d5e562b3904120b042e..8af8814ebe7a62387b17e8a10b926737e06da1f0 100644 (file)
@@ -314,6 +314,7 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
                __read_once_size(&(x), __u.__c, sizeof(x));             \
        else                                                            \
                __read_once_size_nocheck(&(x), __u.__c, sizeof(x));     \
+       smp_read_barrier_depends(); /* Enforce dependency ordering from x */ \
        __u.__val;                                                      \
 })
 #define READ_ONCE(x) __READ_ONCE(x, 1)
@@ -517,7 +518,8 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
 # define __compiletime_error_fallback(condition) do { } while (0)
 #endif
 
-#define __compiletime_assert(condition, msg, prefix, suffix)           \
+#ifdef __OPTIMIZE__
+# define __compiletime_assert(condition, msg, prefix, suffix)          \
        do {                                                            \
                bool __cond = !(condition);                             \
                extern void prefix ## suffix(void) __compiletime_error(msg); \
@@ -525,6 +527,9 @@ static __always_inline void __write_once_size(volatile void *p, void *res, int s
                        prefix ## suffix();                             \
                __compiletime_error_fallback(__cond);                   \
        } while (0)
+#else
+# define __compiletime_assert(condition, msg, prefix, suffix) do { } while (0)
+#endif
 
 #define _compiletime_assert(condition, msg, prefix, suffix) \
        __compiletime_assert(condition, msg, prefix, suffix)