Skip to contentSkip to conversation

powerpc/32s: Include <linux/moduleloader.h> header file to fix a warning

PATCH In review Mathieu Malaterre 2 participants 2 messages May 23, 2019 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/32s: Include <linux/moduleloader.h> header file to fix a warning

In commit 2edb16efc899 ("powerpc/32: Add KASAN support") support for KASAN has been added. However building it as module leads to (warning treated as error with W=1):

arch/powerpc/mm/kasan/kasan_init_32.c:135:7: error: no previous prototype for 'module_alloc' [-Werror=missing-prototypes]

Make sure to include <linux/moduleloader.h> to provide the following
prototype: module_alloc.

---
 arch/powerpc/mm/kasan/kasan_init_32.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/mm/kasan/kasan_init_32.c +1 -0
index 0d62be3cba47..0c31e440d094 100644
@@ -7,6 +7,7 @@
 #include <linux/memblock.h>
 #include <linux/sched/task.h>
 #include <linux/vmalloc.h>
+#include <linux/moduleloader.h>
 #include <asm/pgalloc.h>
 #include <asm/code-patching.h>
 #include <mm/mmu_decl.h>
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Le 23/05/2019 à 08:49, Mathieu Malaterre a écrit :

Quoted 10 lines

In commit 2edb16efc899 ("powerpc/32: Add KASAN support") support for KASAN has been added. However building it as module leads to (warning treated as error with W=1):

arch/powerpc/mm/kasan/kasan_init_32.c:135:7: error: no previous prototype for 'module_alloc' [-Werror=missing-prototypes]

Make sure to include <linux/moduleloader.h> to provide the following
prototype: module_alloc.

Fixes 2edb16efc899 ("powerpc/32: Add KASAN support")
Quoted 17 lines
---
  arch/powerpc/mm/kasan/kasan_init_32.c | 1 +
  1 file changed, 1 insertion(+)
arch/powerpc/mm/kasan/kasan_init_32.c +1 -0
index 0d62be3cba47..0c31e440d094 100644
@@ -7,6 +7,7 @@
  #include <linux/memblock.h>
  #include <linux/sched/task.h>
  #include <linux/vmalloc.h>
+#include <linux/moduleloader.h>
  #include <asm/pgalloc.h>
  #include <asm/code-patching.h>
  #include <mm/mmu_decl.h>