Message ID | 20221103164431.365731-2-teo.coupriediaz@arm.com |
---|---|
State | Accepted |
Headers | show |
Series | Change return type of tst_syscall | expand |
Hi! Reviwed-by: Cyril Hrubis <chrubis@suse.cz>
Hello, Merged! thanks. Cyril Hrubis <chrubis@suse.cz> writes: > Hi! > Reviwed-by: Cyril Hrubis <chrubis@suse.cz> > > -- > Cyril Hrubis > chrubis@suse.cz
diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh index 3bf38fd03..97027e2f3 100755 --- a/include/lapi/syscalls/regen.sh +++ b/include/lapi/syscalls/regen.sh @@ -48,7 +48,7 @@ cat << EOF > "${output_pid}" #endif #define tst_syscall(NR, ...) ({ \\ - int tst_ret; \\ + intptr_t tst_ret; \\ if (NR == __LTP__NR_INVALID_SYSCALL) { \\ errno = ENOSYS; \\ tst_ret = -1; \\
Some syscalls directly return pointers, like brk or mmap. int is currently used for the return value in tst_syscall but is not large enough to guarantee that such a returned value will fit. Instead, use intptr_t which is guaranted to be castable to (void *) without loss of data. Signed-off-by: Teo Couprie Diaz <teo.coupriediaz@arm.com> --- include/lapi/syscalls/regen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)