Click here to Skip to main content
15,441,434 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Update:
omar_mustafa@omar-mustafa-HP-Laptop-15-da1xxx:~/Downloads/ndiswrapper-1.63$ sudo make
make -C utils
make[1]: Entering directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/utils'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/utils'
make -C driver
make[1]: Entering directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver'
make -C /usr/src/linux-headers-5.13.9-051309-generic M=/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver
make[2]: Entering directory '/usr/src/linux-headers-5.13.9-051309-generic'
CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/crt.o
CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/hal.o
CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/iw_ndis.o
CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.o
/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c: In function ‘load_sys_files’:
/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c:157:4: error: too many arguments to function ‘__vmalloc’
157 | __vmalloc(load_driver->sys_files[i].size,
| ^~~~~~~~~
In file included from ./include/asm-generic/io.h:911,
from ./arch/x86/include/asm/io.h:375,
from ./include/linux/scatterlist.h:9,
from ./include/linux/dma-mapping.h:10,
from ./include/linux/skbuff.h:31,
from ./include/net/net_namespace.h:38,
from ./include/linux/netdevice.h:37,
from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/ntoskernel.h:25,
from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/ndis.h:19,
from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c:16:
./include/linux/vmalloc.h:113:14: note: declared here
113 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);
| ^~~~~~~~~
make[3]: *** [scripts/Makefile.build:273: /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.o] Error 1
make[2]: *** [Makefile:1859: /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver] Error 2
make[2]: Leaving directory '/usr/src/linux-headers-5.13.9-051309-generic'
make[1]: *** [Makefile:183: modules] Error 2
make[1]: Leaving directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver'
make: *** [Makefile:23: driver] Error 2


Hi I have been trying to compile a C program but I got this error:
error: too many arguments to function ‘__vmalloc’
  157 |    __vmalloc(load_driver->sys_files[i].size,


The problem is that "_vmalloc" is called from another header file and is defined there as:
C++
extern void *__vmalloc(unsigned long size, gfp_t gfp_mask);


So anyone help me and tell me what's wrong??

What I have tried:

I copied the function declaration to my C file, yet I got the same error
Posted
Updated 5-Sep-21 23:22pm
v3
Comments
Patrice T 6-Sep-21 3:10am     CRLF
Try to show the complete line of code. a few line before and after the offending will not harm either.
Cool_Omar 6-Sep-21 3:34am     CRLF
omar_mustafa@omar-mustafa-HP-Laptop-15-da1xxx:~/Downloads/ndiswrapper-1.63$ sudo make make -C utils make[1]: Entering directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/utils' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/utils' make -C driver make[1]: Entering directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver' make -C /usr/src/linux-headers-5.13.9-051309-generic M=/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver make[2]: Entering directory '/usr/src/linux-headers-5.13.9-051309-generic' CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/crt.o CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/hal.o CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/iw_ndis.o CC [M] /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.o /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c: In function ‘load_sys_files’: /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c:157:4: error: too many arguments to function ‘__vmalloc’ 157 | __vmalloc(load_driver->sys_files[i].size, | ^~~~~~~~~ In file included from ./include/asm-generic/io.h:911, from ./arch/x86/include/asm/io.h:375, from ./include/linux/scatterlist.h:9, from ./include/linux/dma-mapping.h:10, from ./include/linux/skbuff.h:31, from ./include/net/net_namespace.h:38, from ./include/linux/netdevice.h:37, from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/ntoskernel.h:25, from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/ndis.h:19, from /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c:16: ./include/linux/vmalloc.h:113:14: note: declared here 113 | extern void *__vmalloc(unsigned long size, gfp_t gfp_mask); | ^~~~~~~~~ make[3]: *** [scripts/Makefile.build:273: /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.o] Error 1 make[2]: *** [Makefile:1859: /home/omar_mustafa/Downloads/ndiswrapper-1.63/driver] Error 2 make[2]: Leaving directory '/usr/src/linux-headers-5.13.9-051309-generic' make[1]: *** [Makefile:183: modules] Error 2 make[1]: Leaving directory '/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver' make: *** [Makefile:23: driver] Error 2
Patrice T 6-Sep-21 3:36am     CRLF
Use Improve question to update your question. So that everyone can pay attention to this information.

1 solution

/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c: In function ‘load_sys_files’:
/home/omar_mustafa/Downloads/ndiswrapper-1.63/driver/loader.c:157:4: error: too many arguments to function ‘__vmalloc’
157 | __vmalloc(load_driver->sys_files[i].size,
| ^~~~~~~~~

Look at the error message: line 157 of module loader.c is the cause of the problem. So check the source to see why.
 
Share this answer
 
Comments
Cool_Omar 6-Sep-21 5:20am    
@Richard MacCutchan: I did and the source is in vmalloc.h and it says unsigned long while i is integer
Richard MacCutchan 6-Sep-21 5:50am    
But the error is at line 157 of loader.c as I already explained.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900