diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2012-12-17 19:03:24 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 20:15:23 -0500 |
| commit | 8529091e8e2ae25e0f4003086f619765ff255e4b (patch) | |
| tree | 8e0133cdaaab2455290a558fb05ff845d1ec0ae5 /include/linux | |
| parent | a5ba911ec3792168530d35e16a8ec3b6fc60bcb5 (diff) | |
linux/compiler.h: add __must_hold macro for functions called with a lock held
linux/compiler.h has macros to denote functions that acquire or release
locks, but not to denote functions called with a lock held that return
with the lock still held. Add a __must_hold macro to cover that case.
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Reported-by: Ed Cashin <ecashin@coraid.com>
Tested-by: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/compiler.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f430e4162f4..b121554f1fe 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | # define __force __attribute__((force)) | 10 | # define __force __attribute__((force)) |
| 11 | # define __nocast __attribute__((nocast)) | 11 | # define __nocast __attribute__((nocast)) |
| 12 | # define __iomem __attribute__((noderef, address_space(2))) | 12 | # define __iomem __attribute__((noderef, address_space(2))) |
| 13 | # define __must_hold(x) __attribute__((context(x,1,1))) | ||
| 13 | # define __acquires(x) __attribute__((context(x,0,1))) | 14 | # define __acquires(x) __attribute__((context(x,0,1))) |
| 14 | # define __releases(x) __attribute__((context(x,1,0))) | 15 | # define __releases(x) __attribute__((context(x,1,0))) |
| 15 | # define __acquire(x) __context__(x,1) | 16 | # define __acquire(x) __context__(x,1) |
| @@ -33,6 +34,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
| 33 | # define __chk_user_ptr(x) (void)0 | 34 | # define __chk_user_ptr(x) (void)0 |
| 34 | # define __chk_io_ptr(x) (void)0 | 35 | # define __chk_io_ptr(x) (void)0 |
| 35 | # define __builtin_warning(x, y...) (1) | 36 | # define __builtin_warning(x, y...) (1) |
| 37 | # define __must_hold(x) | ||
| 36 | # define __acquires(x) | 38 | # define __acquires(x) |
| 37 | # define __releases(x) | 39 | # define __releases(x) |
| 38 | # define __acquire(x) (void)0 | 40 | # define __acquire(x) (void)0 |
