2018-12-10 08:09:19

by Christophe Leroy

[permalink] [raw]
Subject: [PATCH] lib: fix build failure in CONFIG_DEBUG_VIRTUAL test

On several arches, virt_to_phys() is in io.h

Build fails without it:

CC lib/test_debug_virtual.o
lib/test_debug_virtual.c: In function 'test_debug_virtual_init':
lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration]
pa = virt_to_phys(va);
^

Fixes: e4dace361552 ("lib: add test module for CONFIG_DEBUG_VIRTUAL")
CC: [email protected]
Signed-off-by: Christophe Leroy <[email protected]>
---
lib/test_debug_virtual.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/test_debug_virtual.c b/lib/test_debug_virtual.c
index d5a06addeb27..bf864c73e462 100644
--- a/lib/test_debug_virtual.c
+++ b/lib/test_debug_virtual.c
@@ -5,6 +5,7 @@
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/sizes.h>
+#include <linux/io.h>

#include <asm/page.h>
#ifdef CONFIG_MIPS
--
2.13.3



2018-12-10 18:17:54

by Kees Cook

[permalink] [raw]
Subject: Re: [PATCH] lib: fix build failure in CONFIG_DEBUG_VIRTUAL test

On Mon, Dec 10, 2018 at 12:08 AM Christophe Leroy
<[email protected]> wrote:
>
> On several arches, virt_to_phys() is in io.h
>
> Build fails without it:
>
> CC lib/test_debug_virtual.o
> lib/test_debug_virtual.c: In function 'test_debug_virtual_init':
> lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration]
> pa = virt_to_phys(va);
> ^
>
> Fixes: e4dace361552 ("lib: add test module for CONFIG_DEBUG_VIRTUAL")
> CC: [email protected]
> Signed-off-by: Christophe Leroy <[email protected]>

Reviewed-by: Kees Cook <[email protected]>

-Kees

> ---
> lib/test_debug_virtual.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/test_debug_virtual.c b/lib/test_debug_virtual.c
> index d5a06addeb27..bf864c73e462 100644
> --- a/lib/test_debug_virtual.c
> +++ b/lib/test_debug_virtual.c
> @@ -5,6 +5,7 @@
> #include <linux/vmalloc.h>
> #include <linux/slab.h>
> #include <linux/sizes.h>
> +#include <linux/io.h>
>
> #include <asm/page.h>
> #ifdef CONFIG_MIPS
> --
> 2.13.3
>


--
Kees Cook

2018-12-13 03:11:37

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] lib: fix build failure in CONFIG_DEBUG_VIRTUAL test

Christophe Leroy <[email protected]> writes:

> On several arches, virt_to_phys() is in io.h
>
> Build fails without it:
>
> CC lib/test_debug_virtual.o
> lib/test_debug_virtual.c: In function 'test_debug_virtual_init':
> lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration]
> pa = virt_to_phys(va);
> ^
>
> Fixes: e4dace361552 ("lib: add test module for CONFIG_DEBUG_VIRTUAL")
> CC: [email protected]
> Signed-off-by: Christophe Leroy <[email protected]>
> ---
> lib/test_debug_virtual.c | 1 +
> 1 file changed, 1 insertion(+)

I'm going to take this via the powerpc tree, because otherwise
Christophe's patch to implement CONFIG_DEBUG_VIRTUAL for powerpc will
break the build for us.

Hopefully no one minds :)

cheers

2018-12-23 11:01:28

by Michael Ellerman

[permalink] [raw]
Subject: Re: lib: fix build failure in CONFIG_DEBUG_VIRTUAL test

On Mon, 2018-12-10 at 08:08:28 UTC, Christophe Leroy wrote:
> On several arches, virt_to_phys() is in io.h
>
> Build fails without it:
>
> CC lib/test_debug_virtual.o
> lib/test_debug_virtual.c: In function 'test_debug_virtual_init':
> lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration]
> pa = virt_to_phys(va);
> ^
>
> Fixes: e4dace361552 ("lib: add test module for CONFIG_DEBUG_VIRTUAL")
> CC: [email protected]
> Signed-off-by: Christophe Leroy <[email protected]>
> Reviewed-by: Kees Cook <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/10fdf838e5f540beca466e9d132599

cheers