diff mbox series

cxl/test: Add missing vmalloc.h for tools/testing/cxl/test/mem.c

Message ID 20240528225551.1025977-1-dave.jiang@intel.com
State Accepted
Commit d55510527153d17a3af8cc2df69c04f95ae1350d
Headers show
Series cxl/test: Add missing vmalloc.h for tools/testing/cxl/test/mem.c | expand

Commit Message

Dave Jiang May 28, 2024, 10:55 p.m. UTC
tools/testing/cxl/test/mem.c uses vmalloc() and vfree() but does not
include linux/vmalloc.h. Kernel v6.10 made changes that causes the
currently included headers not depend on vmalloc.h and therefore
mem.c can no longer compile. Add linus/vmalloc.h to fix compile
issue.

  CC [M]  tools/testing/cxl/test/mem.o
tools/testing/cxl/test/mem.c: In function ‘label_area_release’:
tools/testing/cxl/test/mem.c:1428:9: error: implicit declaration of function ‘vfree’; did you mean ‘kvfree’? [-Werror=implicit-function-declaration]
 1428 |         vfree(lsa);
      |         ^~~~~
      |         kvfree
tools/testing/cxl/test/mem.c: In function ‘cxl_mock_mem_probe’:
tools/testing/cxl/test/mem.c:1466:22: error: implicit declaration of function ‘vmalloc’; did you mean ‘kmalloc’? [-Werror=implicit-function-declaration]
 1466 |         mdata->lsa = vmalloc(LSA_SIZE);
      |                      ^~~~~~~
      |                      kmalloc

Fixes: 7d3eb23c4ccf ("tools/testing/cxl: Introduce a mock memory device + driver")
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 tools/testing/cxl/test/mem.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dan Williams May 28, 2024, 11:02 p.m. UTC | #1
Dave Jiang wrote:
> tools/testing/cxl/test/mem.c uses vmalloc() and vfree() but does not
> include linux/vmalloc.h. Kernel v6.10 made changes that causes the
> currently included headers not depend on vmalloc.h and therefore
> mem.c can no longer compile. Add linus/vmalloc.h to fix compile
> issue.
> 
>   CC [M]  tools/testing/cxl/test/mem.o
> tools/testing/cxl/test/mem.c: In function ‘label_area_release’:
> tools/testing/cxl/test/mem.c:1428:9: error: implicit declaration of function ‘vfree’; did you mean ‘kvfree’? [-Werror=implicit-function-declaration]
>  1428 |         vfree(lsa);
>       |         ^~~~~
>       |         kvfree
> tools/testing/cxl/test/mem.c: In function ‘cxl_mock_mem_probe’:
> tools/testing/cxl/test/mem.c:1466:22: error: implicit declaration of function ‘vmalloc’; did you mean ‘kmalloc’? [-Werror=implicit-function-declaration]
>  1466 |         mdata->lsa = vmalloc(LSA_SIZE);
>       |                      ^~~~~~~
>       |                      kmalloc
> 
> Fixes: 7d3eb23c4ccf ("tools/testing/cxl: Introduce a mock memory device + driver")
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  tools/testing/cxl/test/mem.c | 1 +
>  1 file changed, 1 insertion(+)

LGTM

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Alison Schofield May 28, 2024, 11:03 p.m. UTC | #2
On Tue, May 28, 2024 at 03:55:51PM -0700, Dave Jiang wrote:
> tools/testing/cxl/test/mem.c uses vmalloc() and vfree() but does not
> include linux/vmalloc.h. Kernel v6.10 made changes that causes the
> currently included headers not depend on vmalloc.h and therefore
> mem.c can no longer compile. Add linus/vmalloc.h to fix compile
> issue.

s/linus/linux

Reviewed-by: Alison Schofield <alison.schofield@intel.com>


> 
>   CC [M]  tools/testing/cxl/test/mem.o
> tools/testing/cxl/test/mem.c: In function ‘label_area_release’:
> tools/testing/cxl/test/mem.c:1428:9: error: implicit declaration of function ‘vfree’; did you mean ‘kvfree’? [-Werror=implicit-function-declaration]
>  1428 |         vfree(lsa);
>       |         ^~~~~
>       |         kvfree
> tools/testing/cxl/test/mem.c: In function ‘cxl_mock_mem_probe’:
> tools/testing/cxl/test/mem.c:1466:22: error: implicit declaration of function ‘vmalloc’; did you mean ‘kmalloc’? [-Werror=implicit-function-declaration]
>  1466 |         mdata->lsa = vmalloc(LSA_SIZE);
>       |                      ^~~~~~~
>       |                      kmalloc
> 
> Fixes: 7d3eb23c4ccf ("tools/testing/cxl: Introduce a mock memory device + driver")
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  tools/testing/cxl/test/mem.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
> index 6584443144de..eaf091a3d331 100644
> --- a/tools/testing/cxl/test/mem.c
> +++ b/tools/testing/cxl/test/mem.c
> @@ -3,6 +3,7 @@
>  
>  #include <linux/platform_device.h>
>  #include <linux/mod_devicetable.h>
> +#include <linux/vmalloc.h>
>  #include <linux/module.h>
>  #include <linux/delay.h>
>  #include <linux/sizes.h>
> -- 
> 2.45.0
>
diff mbox series

Patch

diff --git a/tools/testing/cxl/test/mem.c b/tools/testing/cxl/test/mem.c
index 6584443144de..eaf091a3d331 100644
--- a/tools/testing/cxl/test/mem.c
+++ b/tools/testing/cxl/test/mem.c
@@ -3,6 +3,7 @@ 
 
 #include <linux/platform_device.h>
 #include <linux/mod_devicetable.h>
+#include <linux/vmalloc.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/sizes.h>