[PATCH 28/45] C++: Move ctx_state enum out of struct context_tracking

From: David Howells
Date: Sun Apr 01 2018 - 16:43:14 EST


Move ctx_state enum out of struct context_tracking so that it isn't limited
in scope.

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---

include/linux/context_tracking_state.h | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index f128dc3be0df..02a9efe0827e 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -5,6 +5,13 @@
#include <linux/percpu.h>
#include <linux/static_key.h>

+enum ctx_state {
+ CONTEXT_DISABLED = -1, /* returned by ct_state() if unknown */
+ CONTEXT_KERNEL = 0,
+ CONTEXT_USER,
+ CONTEXT_GUEST,
+};
+
struct context_tracking {
/*
* When active is false, probes are unset in order
@@ -14,12 +21,7 @@ struct context_tracking {
*/
bool active;
int recursion;
- enum ctx_state {
- CONTEXT_DISABLED = -1, /* returned by ct_state() if unknown */
- CONTEXT_KERNEL = 0,
- CONTEXT_USER,
- CONTEXT_GUEST,
- } state;
+ enum ctx_state state;
};

#ifdef CONFIG_CONTEXT_TRACKING