]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
locking/static_keys: Provide DECLARE and well as DEFINE macros
authorTony Luck <tony.luck@intel.com>
Thu, 1 Sep 2016 18:39:33 +0000 (11:39 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 5 Sep 2016 09:47:31 +0000 (11:47 +0200)
We will need to provide declarations of static keys in header
files. Provide DECLARE_STATIC_KEY_{TRUE,FALSE} macros.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/816881cf85bd3cf13385d212882618f38a3b5d33.1472754711.git.tony.luck@intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/jump_label.h

index 661af564fae8b2662f4fdd8f17557ebc8a443208..595fb46213fc4ae79965af911786b63784cbffd8 100644 (file)
@@ -267,9 +267,15 @@ struct static_key_false {
 #define DEFINE_STATIC_KEY_TRUE(name)   \
        struct static_key_true name = STATIC_KEY_TRUE_INIT
 
+#define DECLARE_STATIC_KEY_TRUE(name)  \
+       extern struct static_key_true name
+
 #define DEFINE_STATIC_KEY_FALSE(name)  \
        struct static_key_false name = STATIC_KEY_FALSE_INIT
 
+#define DECLARE_STATIC_KEY_FALSE(name) \
+       extern struct static_key_false name
+
 extern bool ____wrong_branch_error(void);
 
 #define static_key_enabled(x)                                                  \