[RFC 2/3] linux-user: Drop uint and ulong

Juan Quintela posted 3 patches 2 years, 9 months ago
Maintainers: Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Laurent Vivier <laurent@vivier.eu>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>
[RFC 2/3] linux-user: Drop uint and ulong
Posted by Juan Quintela 2 years, 9 months ago
I know I am getting into trouble and into big depths, but there is any
reason why we can't use regular type names?

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 linux-user/mmap.c    | 2 +-
 linux-user/syscall.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 0aa8ae7356..51d40c77e4 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -859,7 +859,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size,
 
 static bool can_passthrough_madvise(abi_ulong start, abi_ulong end)
 {
-    ulong addr;
+    unsigned long addr;
 
     if ((start | end) & ~qemu_host_page_mask) {
         return false;
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 69f740ff98..dd0349712b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -309,16 +309,16 @@ _syscall0(int, sys_gettid)
 #endif
 
 #if defined(TARGET_NR_getdents) && defined(EMULATE_GETDENTS_WITH_GETDENTS)
-_syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count);
+_syscall3(int, sys_getdents, unsigned int, fd, struct linux_dirent *, dirp, unsigned int, count);
 #endif
 #if (defined(TARGET_NR_getdents) && \
       !defined(EMULATE_GETDENTS_WITH_GETDENTS)) || \
     (defined(TARGET_NR_getdents64) && defined(__NR_getdents64))
-_syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
+_syscall3(int, sys_getdents64, unsigned int, fd, struct linux_dirent64 *, dirp, unsigned int, count);
 #endif
 #if defined(TARGET_NR__llseek) && defined(__NR_llseek)
-_syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
-          loff_t *, res, uint, wh);
+_syscall5(int, _llseek,  unsigned int,  fd, unsigned long, hi, unsigned long, lo,
+          loff_t *, res, unsigned int, wh);
 #endif
 _syscall3(int, sys_rt_sigqueueinfo, pid_t, pid, int, sig, siginfo_t *, uinfo)
 _syscall4(int, sys_rt_tgsigqueueinfo, pid_t, pid, pid_t, tid, int, sig,
-- 
2.40.1
Re: [RFC 2/3] linux-user: Drop uint and ulong
Posted by Richard Henderson 2 years, 9 months ago
On 5/10/23 15:39, Juan Quintela wrote:
>   static bool can_passthrough_madvise(abi_ulong start, abi_ulong end)
>   {
> -    ulong addr;
> +    unsigned long addr;

This should be abi_ulong, to match the parameters.
Which should matter for 32-bit host and 64-bit guest.

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Re: [RFC 2/3] linux-user: Drop uint and ulong
Posted by Juan Quintela 2 years, 9 months ago
Richard Henderson <richard.henderson@linaro.org> wrote:
> On 5/10/23 15:39, Juan Quintela wrote:
>>   static bool can_passthrough_madvise(abi_ulong start, abi_ulong end)
>>   {
>> -    ulong addr;
>> +    unsigned long addr;
>
> This should be abi_ulong, to match the parameters.
> Which should matter for 32-bit host and 64-bit guest.
>
> Otherwise,

Thanks.  Changing it.

> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>
>
> r~