kmsan: include linux/vmalloc.h

Message ID 20221215163046.4079767-1-arnd@kernel.org
State New
Headers
Series kmsan: include linux/vmalloc.h |

Commit Message

Arnd Bergmann Dec. 15, 2022, 4:30 p.m. UTC
  From: Arnd Bergmann <arnd@arndb.de>

This is needed for the vmap/vunmap declarations:

mm/kmsan/kmsan_test.c:316:9: error: implicit declaration of function 'vmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
               ^
mm/kmsan/kmsan_test.c:316:29: error: use of undeclared identifier 'VM_MAP'
        vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
                                   ^
mm/kmsan/kmsan_test.c:322:3: error: implicit declaration of function 'vunmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                vunmap(vbuf);
                ^

Fixes: 8ed691b02ade ("kmsan: add tests for KMSAN")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 mm/kmsan/kmsan_test.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Alexander Potapenko Dec. 15, 2022, 4:39 p.m. UTC | #1
On Thu, Dec 15, 2022 at 5:30 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> This is needed for the vmap/vunmap declarations:
>
> mm/kmsan/kmsan_test.c:316:9: error: implicit declaration of function 'vmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>         vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
>                ^
> mm/kmsan/kmsan_test.c:316:29: error: use of undeclared identifier 'VM_MAP'
>         vbuf = vmap(pages, npages, VM_MAP, PAGE_KERNEL);
>                                    ^
> mm/kmsan/kmsan_test.c:322:3: error: implicit declaration of function 'vunmap' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
>                 vunmap(vbuf);
>                 ^
>
> Fixes: 8ed691b02ade ("kmsan: add tests for KMSAN")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Alexander Potapenko <glider@google.com>

> ---
>  mm/kmsan/kmsan_test.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c
> index eb44ef3c5f29..088e21a48dc4 100644
> --- a/mm/kmsan/kmsan_test.c
> +++ b/mm/kmsan/kmsan_test.c
> @@ -22,6 +22,7 @@
>  #include <linux/spinlock.h>
>  #include <linux/string.h>
>  #include <linux/tracepoint.h>
> +#include <linux/vmalloc.h>
>  #include <trace/events/printk.h>
>
>  static DEFINE_PER_CPU(int, per_cpu_var);
> --
> 2.35.1
>
  

Patch

diff --git a/mm/kmsan/kmsan_test.c b/mm/kmsan/kmsan_test.c
index eb44ef3c5f29..088e21a48dc4 100644
--- a/mm/kmsan/kmsan_test.c
+++ b/mm/kmsan/kmsan_test.c
@@ -22,6 +22,7 @@ 
 #include <linux/spinlock.h>
 #include <linux/string.h>
 #include <linux/tracepoint.h>
+#include <linux/vmalloc.h>
 #include <trace/events/printk.h>
 
 static DEFINE_PER_CPU(int, per_cpu_var);