Commit d398efb9 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] compiler.h scoping fixes

From: Ville Nuorvala <vnuorval@tcs.hut.fi>

There are a few kernel-only things in compiler.h which should have been
placed inside __KERNEL__.
parent 3b704d3f
...@@ -39,6 +39,20 @@ ...@@ -39,6 +39,20 @@
#define likely(x) __builtin_expect(!!(x), 1) #define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0) #define unlikely(x) __builtin_expect(!!(x), 0)
/* Optimization barrier */
#ifndef barrier
# define barrier() __memory_barrier()
#endif
#ifndef RELOC_HIDE
# define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
__ptr = (unsigned long) (ptr); \
(typeof(ptr)) (__ptr + (off)); })
#endif
#endif /* __KERNEL__ */
/* /*
* Allow us to mark functions as 'deprecated' and have gcc emit a nice * Allow us to mark functions as 'deprecated' and have gcc emit a nice
* warning for each use, in hopes of speeding the functions removal. * warning for each use, in hopes of speeding the functions removal.
...@@ -100,18 +114,4 @@ ...@@ -100,18 +114,4 @@
#define noinline #define noinline
#endif #endif
/* Optimization barrier */
#ifndef barrier
# define barrier() __memory_barrier()
#endif
#ifndef RELOC_HIDE
# define RELOC_HIDE(ptr, off) \
({ unsigned long __ptr; \
__ptr = (unsigned long) (ptr); \
(typeof(ptr)) (__ptr + (off)); })
#endif
#endif /* __KERNEL__ */
#endif /* __LINUX_COMPILER_H */ #endif /* __LINUX_COMPILER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment