diff mbox series

[1/2] tools: fix userspace compilation with new test_xarray changes

Message ID 20240423180517.256812-2-mcgrof@kernel.org (mailing list archive)
State New, archived
Headers show
Series test_xarray: couple of fixes for v6-9-rc6 | expand

Commit Message

Luis Chamberlain April 23, 2024, 6:05 p.m. UTC
Liam reported that compiling the test_xarray on userspace was broken.
I was not even aware that was possible but you can via and you can
run these tests in userspace with:

make -C tools/testing/radix-tree
./tools/testing/radix-tree/xarray

Add the two helpers we need to fix compilation. We don't need a
userspace schedule() so just make it do nothing.

Reported-by: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 tools/testing/radix-tree/linux/kernel.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Liam R. Howlett April 24, 2024, 3:10 p.m. UTC | #1
* Luis Chamberlain <mcgrof@kernel.org> [240423 14:05]:
> Liam reported that compiling the test_xarray on userspace was broken.
> I was not even aware that was possible but you can via and you can
> run these tests in userspace with:
> 
> make -C tools/testing/radix-tree
> ./tools/testing/radix-tree/xarray
> 
> Add the two helpers we need to fix compilation. We don't need a
> userspace schedule() so just make it do nothing.
> 
> Reported-by: "Liam R. Howlett" <Liam.Howlett@oracle.com>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

Tested-by: Liam R. Howlett <Liam.Howlett@oracle.com>

> ---
>  tools/testing/radix-tree/linux/kernel.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
> index c5c9d05f29da..c0a2bb785b92 100644
> --- a/tools/testing/radix-tree/linux/kernel.h
> +++ b/tools/testing/radix-tree/linux/kernel.h
> @@ -18,6 +18,8 @@
>  #define pr_info printk
>  #define pr_debug printk
>  #define pr_cont printk
> +#define schedule()
> +#define PAGE_SHIFT	12
>  
>  #define __acquires(x)
>  #define __releases(x)
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/tools/testing/radix-tree/linux/kernel.h b/tools/testing/radix-tree/linux/kernel.h
index c5c9d05f29da..c0a2bb785b92 100644
--- a/tools/testing/radix-tree/linux/kernel.h
+++ b/tools/testing/radix-tree/linux/kernel.h
@@ -18,6 +18,8 @@ 
 #define pr_info printk
 #define pr_debug printk
 #define pr_cont printk
+#define schedule()
+#define PAGE_SHIFT	12
 
 #define __acquires(x)
 #define __releases(x)