* [PATCH] arm64: kasan: fix issues reported by sparse
@ 2015-10-13 13:01 Will Deacon
2015-10-13 13:26 ` Andrey Ryabinin
0 siblings, 1 reply; 2+ messages in thread
From: Will Deacon @ 2015-10-13 13:01 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
arch/arm64/include/asm/kasan.h | 2 ++
arch/arm64/mm/kasan_init.c | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/kasan.h b/arch/arm64/include/asm/kasan.h
index 71dfe14acdca..2774fa384c47 100644
--- a/arch/arm64/include/asm/kasan.h
+++ b/arch/arm64/include/asm/kasan.h
@@ -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) { }
diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c
index b6a92f5dd568..cf038c7d9fa9 100644
--- a/arch/arm64/mm/kasan_init.c
+++ b/arch/arm64/mm/kasan_init.c
@@ -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));
--
2.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] arm64: kasan: fix issues reported by sparse
2015-10-13 13:01 [PATCH] arm64: kasan: fix issues reported by sparse Will Deacon
@ 2015-10-13 13:26 ` Andrey Ryabinin
0 siblings, 0 replies; 2+ messages in thread
From: Andrey Ryabinin @ 2015-10-13 13:26 UTC (permalink / raw)
To: linux-arm-kernel
On 10/13/2015 04:01 PM, Will Deacon wrote:
> 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>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-13 13:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-13 13:01 [PATCH] arm64: kasan: fix issues reported by sparse Will Deacon
2015-10-13 13:26 ` Andrey Ryabinin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).