Skip to contentSkip to conversation

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

PATCH In review Dave Jiang 3 participants 3 messages May 28, 2024 CXL

lore
Share & tools
lore

Dave Jiang

author maintainer
#0 lore raw

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

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")
---
 tools/testing/cxl/test/mem.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/cxl/test/mem.c +1 -0
index 6584443144de..eaf091a3d331 100644
@@ -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>
Signature · 1 line
2.45.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Dave Jiang

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
Quoted 5 lines
Fixes 7d3eb23c4ccf ("tools/testing/cxl: Introduce a mock memory device + driver")
---
 tools/testing/cxl/test/mem.c | 1 +
 1 file changed, 1 insertion(+)

LGTM

maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Dave Jiang
Quoted 5 lines · Dave Jiang

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

Quoted 34 lines

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")
---
 tools/testing/cxl/test/mem.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/cxl/test/mem.c +1 -0
index 6584443144de..eaf091a3d331 100644
@@ -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>
Signature · 1 line
2.45.0