Thread (17 messages) 17 messages, 3 authors, 2015-08-21
STALE3932d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 3/8] jump_label: introduce DEFINE_STATIC_KEY_{TRUE, FALSE}_ARRAY macros

From: Kevin Hao <hidden>
Date: 2015-08-20 12:15:07
Also in: lkml
Subsystem: static branch/call, the rest · Maintainers: Peter Zijlstra, Josh Poimboeuf, Jason Baron, Alice Ryhl, Linus Torvalds

These are used to define a static_key_{true,false} array.

Signed-off-by: Kevin Hao <redacted>
---
 include/linux/jump_label.h | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 7f653e8f6690..5c1d6a49dd6b 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -267,6 +267,12 @@ struct static_key_false {
 #define DEFINE_STATIC_KEY_FALSE(name)	\
 	struct static_key_false name = STATIC_KEY_FALSE_INIT
 
+#define DEFINE_STATIC_KEY_TRUE_ARRAY(name, n)	\
+	struct static_key_true name[n] = { [0 ... n - 1] = STATIC_KEY_TRUE_INIT }
+
+#define DEFINE_STATIC_KEY_FALSE_ARRAY(name, n)	\
+	struct static_key_false name[n] = { [0 ... n - 1] = STATIC_KEY_FALSE_INIT }
+
 #ifdef HAVE_JUMP_LABEL
 
 /*
-- 
2.1.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help