printf: Remove unused 'bprintf'
[drm/drm-misc.git] / include / linux / kasan-enabled.h
blob6f612d69ea0ca693d98602bc3d4af7a976b2166a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_KASAN_ENABLED_H
3 #define _LINUX_KASAN_ENABLED_H
5 #include <linux/static_key.h>
7 #ifdef CONFIG_KASAN_HW_TAGS
9 DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
11 static __always_inline bool kasan_enabled(void)
13 return static_branch_likely(&kasan_flag_enabled);
16 static inline bool kasan_hw_tags_enabled(void)
18 return kasan_enabled();
21 #else /* CONFIG_KASAN_HW_TAGS */
23 static inline bool kasan_enabled(void)
25 return IS_ENABLED(CONFIG_KASAN);
28 static inline bool kasan_hw_tags_enabled(void)
30 return false;
33 #endif /* CONFIG_KASAN_HW_TAGS */
35 #endif /* LINUX_KASAN_ENABLED_H */