kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h
authorMarco Elver <elver@google.com>
Tue, 31 Mar 2020 19:32:32 +0000 (21:32 +0200)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 14 Apr 2020 00:18:14 +0000 (17:18 -0700)
Both affect access checks, and should therefore be in kcsan-checks.h.
This is in preparation to use these in compiler.h.

Acked-by: Will Deacon <will@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
include/linux/kcsan-checks.h
include/linux/kcsan.h

index 101df7f46d892462c3b45a6ec24965123c535972..ef95ddc4918259196b259a11785e183ce5be6b03 100644 (file)
  */
 void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
 
+/**
+ * kcsan_disable_current - disable KCSAN for the current context
+ *
+ * Supports nesting.
+ */
+void kcsan_disable_current(void);
+
+/**
+ * kcsan_enable_current - re-enable KCSAN for the current context
+ *
+ * Supports nesting.
+ */
+void kcsan_enable_current(void);
+
 /**
  * kcsan_nestable_atomic_begin - begin nestable atomic region
  *
@@ -133,6 +147,8 @@ void kcsan_end_scoped_access(struct kcsan_scoped_access *sa);
 static inline void __kcsan_check_access(const volatile void *ptr, size_t size,
                                        int type) { }
 
+static inline void kcsan_disable_current(void)         { }
+static inline void kcsan_enable_current(void)          { }
 static inline void kcsan_nestable_atomic_begin(void)   { }
 static inline void kcsan_nestable_atomic_end(void)     { }
 static inline void kcsan_flat_atomic_begin(void)       { }
index 17ae59e4b685ce9c477f890aa69ad852c7b998dc..53340d8789f97ac0a2341100e5a10f3f9f838c0c 100644 (file)
@@ -50,25 +50,9 @@ struct kcsan_ctx {
  */
 void kcsan_init(void);
 
-/**
- * kcsan_disable_current - disable KCSAN for the current context
- *
- * Supports nesting.
- */
-void kcsan_disable_current(void);
-
-/**
- * kcsan_enable_current - re-enable KCSAN for the current context
- *
- * Supports nesting.
- */
-void kcsan_enable_current(void);
-
 #else /* CONFIG_KCSAN */
 
 static inline void kcsan_init(void)                    { }
-static inline void kcsan_disable_current(void)         { }
-static inline void kcsan_enable_current(void)          { }
 
 #endif /* CONFIG_KCSAN */