]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
linux/compiler.h: add __must_hold macro for functions called with a lock held
authorJosh Triplett <josh@joshtriplett.org>
Sat, 3 Nov 2012 00:43:07 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Nov 2012 04:15:35 +0000 (15:15 +1100)
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>
include/linux/compiler.h

index f430e4162f41ea188fdb5168df28b4304b7c14c3..b121554f1fe29d1f8ebefb675557bd98ed71dac2 100644 (file)
@@ -10,6 +10,7 @@
 # define __force       __attribute__((force))
 # define __nocast      __attribute__((nocast))
 # define __iomem       __attribute__((noderef, address_space(2)))
+# define __must_hold(x)        __attribute__((context(x,1,1)))
 # define __acquires(x) __attribute__((context(x,0,1)))
 # define __releases(x) __attribute__((context(x,1,0)))
 # define __acquire(x)  __context__(x,1)
@@ -33,6 +34,7 @@ extern void __chk_io_ptr(const volatile void __iomem *);
 # define __chk_user_ptr(x) (void)0
 # define __chk_io_ptr(x) (void)0
 # define __builtin_warning(x, y...) (1)
+# define __must_hold(x)
 # define __acquires(x)
 # define __releases(x)
 # define __acquire(x) (void)0