diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:38:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:38:49 -0500 |
commit | 7c2db36e730ee4facd341679ecb21ee73ba92831 (patch) | |
tree | 75016fba72aaf0581b9263f7fa4c565e6e634f3c /include/linux/compiler.h | |
parent | 8b5628ab83b671f96ac9f174c1bd51c92589fc82 (diff) | |
parent | a47a376f1c025e23e836c0376813c0424de665c2 (diff) |
Merge branch 'akpm' (incoming from Andrew)
Merge misc patches from Andrew Morton:
- Florian has vanished so I appear to have become fbdev maintainer
again :(
- Joel and Mark are distracted to welcome to the new OCFS2 maintainer
- The backlight queue
- Small core kernel changes
- lib/ updates
- The rtc queue
- Various random bits
* akpm: (164 commits)
rtc: rtc-davinci: use devm_*() functions
rtc: rtc-max8997: use devm_request_threaded_irq()
rtc: rtc-max8907: use devm_request_threaded_irq()
rtc: rtc-da9052: use devm_request_threaded_irq()
rtc: rtc-wm831x: use devm_request_threaded_irq()
rtc: rtc-tps80031: use devm_request_threaded_irq()
rtc: rtc-lp8788: use devm_request_threaded_irq()
rtc: rtc-coh901331: use devm_clk_get()
rtc: rtc-vt8500: use devm_*() functions
rtc: rtc-tps6586x: use devm_request_threaded_irq()
rtc: rtc-imxdi: use devm_clk_get()
rtc: rtc-cmos: use dev_warn()/dev_dbg() instead of printk()/pr_debug()
rtc: rtc-pcf8583: use dev_warn() instead of printk()
rtc: rtc-sun4v: use pr_warn() instead of printk()
rtc: rtc-vr41xx: use dev_info() instead of printk()
rtc: rtc-rs5c313: use pr_err() instead of printk()
rtc: rtc-at91rm9200: use dev_dbg()/dev_err() instead of printk()/pr_debug()
rtc: rtc-rs5c372: use dev_dbg()/dev_warn() instead of printk()/pr_debug()
rtc: rtc-ds2404: use dev_err() instead of printk()
rtc: rtc-efi: use dev_err()/dev_warn()/pr_err() instead of printk()
...
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r-- | include/linux/compiler.h | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index dd852b73b286..10b8f23fab0f 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -307,10 +307,36 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
307 | #endif | 307 | #endif |
308 | #ifndef __compiletime_error | 308 | #ifndef __compiletime_error |
309 | # define __compiletime_error(message) | 309 | # define __compiletime_error(message) |
310 | # define __compiletime_error_fallback(condition) \ | ||
311 | do { ((void)sizeof(char[1 - 2 * condition])); } while (0) | ||
312 | #else | ||
313 | # define __compiletime_error_fallback(condition) do { } while (0) | ||
310 | #endif | 314 | #endif |
311 | #ifndef __linktime_error | 315 | |
312 | # define __linktime_error(message) | 316 | #define __compiletime_assert(condition, msg, prefix, suffix) \ |
313 | #endif | 317 | do { \ |
318 | bool __cond = !(condition); \ | ||
319 | extern void prefix ## suffix(void) __compiletime_error(msg); \ | ||
320 | if (__cond) \ | ||
321 | prefix ## suffix(); \ | ||
322 | __compiletime_error_fallback(__cond); \ | ||
323 | } while (0) | ||
324 | |||
325 | #define _compiletime_assert(condition, msg, prefix, suffix) \ | ||
326 | __compiletime_assert(condition, msg, prefix, suffix) | ||
327 | |||
328 | /** | ||
329 | * compiletime_assert - break build and emit msg if condition is false | ||
330 | * @condition: a compile-time constant condition to check | ||
331 | * @msg: a message to emit if condition is false | ||
332 | * | ||
333 | * In tradition of POSIX assert, this macro will break the build if the | ||
334 | * supplied condition is *false*, emitting the supplied error message if the | ||
335 | * compiler has support to do so. | ||
336 | */ | ||
337 | #define compiletime_assert(condition, msg) \ | ||
338 | _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__) | ||
339 | |||
314 | /* | 340 | /* |
315 | * Prevent the compiler from merging or refetching accesses. The compiler | 341 | * Prevent the compiler from merging or refetching accesses. The compiler |
316 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 342 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |