[PATCH v1 -next] kasan: fix a missing header include of static_keys.h

Joey Gouly joey.gouly at arm.com
Tue Mar 1 07:45:18 PST 2022


The kasan-enabled.h header relies on static keys, so make sure
to include the header to avoid compilation errors (with JUMP_LABEL=n).

It fixes the following:
./include/linux/kasan-enabled.h:9:1: warning: data definition has no type or storage class
    9 | DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
      | ^~~~~~~~~~~~~~~~~~~~~~~~
error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_FALSE' [-Werror=implicit-int]

Fixes: f9b5e46f4097 ("kasan: split kasan_*enabled() functions into a separate header")
Cc: Peter Collingbourne <pcc at google.com>
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
---
 include/linux/kasan-enabled.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/kasan-enabled.h b/include/linux/kasan-enabled.h
index 4b6615375022..6f612d69ea0c 100644
--- a/include/linux/kasan-enabled.h
+++ b/include/linux/kasan-enabled.h
@@ -2,6 +2,8 @@
 #ifndef _LINUX_KASAN_ENABLED_H
 #define _LINUX_KASAN_ENABLED_H
 
+#include <linux/static_key.h>
+
 #ifdef CONFIG_KASAN_HW_TAGS
 
 DECLARE_STATIC_KEY_FALSE(kasan_flag_enabled);
-- 
2.17.1




More information about the linux-arm-kernel mailing list