Skip to contentSkip to conversation

arm64: kasan: fix issues reported by sparse

PATCH New Will Deacon 2 participants 2 messages Oct 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: kasan: fix issues reported by sparse

Sparse reports some new issues introduced by the kasan patches:

arch/arm64/mm/kasan_init.c:91:13: warning: no previous prototype for 'kasan_early_init' [-Wmissing-prototypes] void __init kasan_early_init(void)

             ^

arch/arm64/mm/kasan_init.c:91:13: warning: symbol 'kasan_early_init' was not declared. Should it be static? [sparse]

This patch resolves the problem by adding a prototype for kasan_early_init and marking the function as asmlinkage, since it's only called from head.S.

---
 arch/arm64/include/asm/kasan.h | 2 ++
 arch/arm64/mm/kasan_init.c     | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
arch/arm64/include/asm/kasan.h +2 -0
index 71dfe14acdca..2774fa384c47 100644
@@ -5,6 +5,7 @@
 
 #ifdef CONFIG_KASAN
 
+#include <linux/linkage.h>
 #include <asm/memory.h>
 
 /*
@@ -27,6 +28,7 @@
 #define KASAN_SHADOW_OFFSET     (KASAN_SHADOW_END - (1ULL << (64 - 3)))
 
 void kasan_init(void);
+asmlinkage void kasan_early_init(void);
 
 #else
 static inline void kasan_init(void) { }
arch/arm64/mm/kasan_init.c +1 -1
index b6a92f5dd568..cf038c7d9fa9 100644
@@ -88,7 +88,7 @@ static void __init kasan_map_early_shadow(void)
 	} while (pgd++, addr = next, addr != end);
 }
 
-void __init kasan_early_init(void)
+asmlinkage void __init kasan_early_init(void)
 {
 	BUILD_BUG_ON(KASAN_SHADOW_OFFSET != KASAN_SHADOW_END - (1UL << 61));
 	BUILD_BUG_ON(!IS_ALIGNED(KASAN_SHADOW_START, PGDIR_SIZE));
Signature · 1 line
2.1.4
maintainer
#1 lore raw

PATCH 1/1 arm64: kasan: fix issues reported by sparse

Quoted 5 lines · Will Deacon

Sparse reports some new issues introduced by the kasan patches:

arch/arm64/mm/kasan_init.c:91:13: warning: no previous prototype for 'kasan_early_init' [-Wmissing-prototypes] void __init kasan_early_init(void)

             ^
Quoted 8 lines

arch/arm64/mm/kasan_init.c:91:13: warning: symbol 'kasan_early_init' was not declared. Should it be static? [sparse]

This patch resolves the problem by adding a prototype for kasan_early_init and marking the function as asmlinkage, since it's only called from head.S.