Skip to content

Commit 01b4ff5

Browse files
melverpaulmckrcu
authored andcommitted
kcsan: Move kcsan_{disable,enable}_current() to kcsan-checks.h
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 <[email protected]> Signed-off-by: Marco Elver <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]>
1 parent d8949ef commit 01b4ff5

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

include/linux/kcsan-checks.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
*/
3737
void __kcsan_check_access(const volatile void *ptr, size_t size, int type);
3838

39+
/**
40+
* kcsan_disable_current - disable KCSAN for the current context
41+
*
42+
* Supports nesting.
43+
*/
44+
void kcsan_disable_current(void);
45+
46+
/**
47+
* kcsan_enable_current - re-enable KCSAN for the current context
48+
*
49+
* Supports nesting.
50+
*/
51+
void kcsan_enable_current(void);
52+
3953
/**
4054
* kcsan_nestable_atomic_begin - begin nestable atomic region
4155
*
@@ -133,6 +147,8 @@ void kcsan_end_scoped_access(struct kcsan_scoped_access *sa);
133147
static inline void __kcsan_check_access(const volatile void *ptr, size_t size,
134148
int type) { }
135149

150+
static inline void kcsan_disable_current(void) { }
151+
static inline void kcsan_enable_current(void) { }
136152
static inline void kcsan_nestable_atomic_begin(void) { }
137153
static inline void kcsan_nestable_atomic_end(void) { }
138154
static inline void kcsan_flat_atomic_begin(void) { }

include/linux/kcsan.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,9 @@ struct kcsan_ctx {
5050
*/
5151
void kcsan_init(void);
5252

53-
/**
54-
* kcsan_disable_current - disable KCSAN for the current context
55-
*
56-
* Supports nesting.
57-
*/
58-
void kcsan_disable_current(void);
59-
60-
/**
61-
* kcsan_enable_current - re-enable KCSAN for the current context
62-
*
63-
* Supports nesting.
64-
*/
65-
void kcsan_enable_current(void);
66-
6753
#else /* CONFIG_KCSAN */
6854

6955
static inline void kcsan_init(void) { }
70-
static inline void kcsan_disable_current(void) { }
71-
static inline void kcsan_enable_current(void) { }
7256

7357
#endif /* CONFIG_KCSAN */
7458

0 commit comments

Comments
 (0)