lkml.org 
[lkml]   [2018]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 21/23] jump_label: move JUMP_TYPE_* constants to new asm-generic file
Date
I'm going to need to refer to the JUMP_TYPE_FALSE and JUMP_TYPE_TRUE
constants from asm code. In order to do that, move them to an
asm-generic header and define them using the UL() helper macro.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jason Baron <jbaron@akamai.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/jump_label.h | 11 +++++++++++
include/linux/jump_label.h | 6 +-----
2 files changed, 12 insertions(+), 5 deletions(-)
create mode 100644 include/asm-generic/jump_label.h

diff --git a/include/asm-generic/jump_label.h b/include/asm-generic/jump_label.h
new file mode 100644
index 000000000000..ff72c4c68ce3
--- /dev/null
+++ b/include/asm-generic/jump_label.h
@@ -0,0 +1,11 @@
+#ifndef __ASM_GENERIC_JUMP_LABEL_H
+#define __ASM_GENERIC_JUMP_LABEL_H
+
+#include <linux/const.h>
+
+#define JUMP_TYPE_FALSE UL(0)
+#define JUMP_TYPE_TRUE UL(1)
+#define JUMP_TYPE_LINKED UL(2)
+#define JUMP_TYPE_MASK UL(3)
+
+#endif /* __ASM_GENERIC_JUMP_LABEL_H */
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 5df6a621e464..989fa8c328fd 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -119,6 +119,7 @@ struct static_key {

#ifdef HAVE_JUMP_LABEL
#include <asm/jump_label.h>
+#include <asm-generic/jump_label.h>

#ifndef __ASSEMBLY__
#ifdef CONFIG_HAVE_ARCH_JUMP_LABEL_RELATIVE
@@ -194,11 +195,6 @@ struct module;

#ifdef HAVE_JUMP_LABEL

-#define JUMP_TYPE_FALSE 0UL
-#define JUMP_TYPE_TRUE 1UL
-#define JUMP_TYPE_LINKED 2UL
-#define JUMP_TYPE_MASK 3UL
-
static __always_inline bool static_key_false(struct static_key *key)
{
return arch_static_branch(key, false);
--
2.19.1.6.gbde171bbf5
\
 
 \ /
  Last update: 2018-11-10 00:12    [W:0.193 / U:21.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site