arm64: kasan: fix issues reported by sparse
authorWill Deacon <will.deacon@arm.com>
Tue, 13 Oct 2015 13:01:06 +0000 (14:01 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 13 Oct 2015 13:54:42 +0000 (14:54 +0100)
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.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Acked-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/kasan.h
arch/arm64/mm/kasan_init.c

index 71dfe14acdcae8589aa7441ddcc137cf7367389c..2774fa384c47f27b4e936644cef0e980f7fbcfe7 100644 (file)
@@ -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) { }
index b6a92f5dd568af7bbd013fbdff290773ac49f6e3..cf038c7d9fa994c7d86e05920ffa8961aecc4ad8 100644 (file)
@@ -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));