From: Tony Luck Date: Thu, 1 Sep 2016 18:39:33 +0000 (-0700) Subject: locking/static_keys: Provide DECLARE and well as DEFINE macros X-Git-Tag: v4.1.12-124.31.3~465 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d9fd25024bc89a28158e11162355a3f9ce6a9810;p=users%2Fjedix%2Flinux-maple.git locking/static_keys: Provide DECLARE and well as DEFINE macros We will need to provide declarations of static keys in header files. Provide DECLARE_STATIC_KEY_{TRUE,FALSE} macros. Signed-off-by: Tony Luck Acked-by: Borislav Petkov Cc: Peter Zijlstra Cc: Dan Williams Cc: Linus Torvalds Link: http://lkml.kernel.org/r/816881cf85bd3cf13385d212882618f38a3b5d33.1472754711.git.tony.luck@intel.com Signed-off-by: Thomas Gleixner (cherry picked from commit b8fb03785d4de097507d0cf45873525e0ac4d2b2) Orabug: 28607548 Signed-off-by: Alexandre Chartre Reviewed-by: Darren Kenny Reviewed-by: Mihai Carabas Reviewed-by: Boris Ostrovsky Signed-off-by: Brian Maly --- diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 455a49f8dc45..588463cb3373 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h @@ -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) \