[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 18/19] linux-user: Remove type casts to union type
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 18/19] linux-user: Remove type casts to union type |
Date: |
Thu, 8 Oct 2015 19:52:27 +0300 |
From: Stefan Weil <address@hidden>
Casting to a union type is a gcc (and clang) extension. Other compilers
might not support it. This is not a problem today, but the type casts
can be removed easily. Smatch now no longer complains like before:
linux-user/syscall.c:3190:18: warning: cast to non-scalar
linux-user/syscall.c:7348:44: warning: cast to non-scalar
Cc: Riku Voipio <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
linux-user/syscall.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index b8ce208..8bfb24f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2728,8 +2728,9 @@ static inline abi_long host_to_target_semarray(int semid,
abi_ulong target_addr,
}
static inline abi_long do_semctl(int semid, int semnum, int cmd,
- union target_semun target_su)
+ abi_ulong target_arg)
{
+ union target_semun target_su = { .buf = target_arg };
union semun arg;
struct semid_ds dsarg;
unsigned short *array = NULL;
@@ -3251,8 +3252,7 @@ static abi_long do_ipc(unsigned int call, abi_long first,
* ptr argument. */
abi_ulong atptr;
get_user_ual(atptr, ptr);
- ret = do_semctl(first, second, third,
- (union target_semun) atptr);
+ ret = do_semctl(first, second, third, atptr);
break;
}
@@ -7550,7 +7550,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#endif
#ifdef TARGET_NR_semctl
case TARGET_NR_semctl:
- ret = do_semctl(arg1, arg2, arg3, (union target_semun)(abi_ulong)arg4);
+ ret = do_semctl(arg1, arg2, arg3, arg4);
break;
#endif
#ifdef TARGET_NR_msgctl
--
2.1.4
- [Qemu-trivial] [PULL 17/19] linux-user: Use g_new() & friends where that makes obvious sense, (continued)
- [Qemu-trivial] [PULL 17/19] linux-user: Use g_new() & friends where that makes obvious sense, Michael Tokarev, 2015/10/08
- [Qemu-trivial] [PULL 02/19] sdhci: use PRIx64 for uint64_t type, Michael Tokarev, 2015/10/08
- [Qemu-trivial] [PULL 11/19] MAINTAINERS: Add NSIS file for W32, W64 hosts, Michael Tokarev, 2015/10/08
- Re: [Qemu-trivial] [Qemu-devel] [PULL 00/19] Trivial patches for 2015-10-08, Peter Maydell, 2015/10/09
- [Qemu-trivial] [PULL 01/19] Add .dir-locals.el file to configure emacs coding style, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 16/19] rocker: Use g_new() & friends where that makes obvious sense, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 04/19] imx_serial: Generate interrupt on tx empty if enabled, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 08/19] s/cpu_get_real_ticks/cpu_get_host_ticks/, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 06/19] pci-assign: do not include sys/io.h, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 18/19] linux-user: Remove type casts to union type,
Michael Tokarev <=
- [Qemu-trivial] [PULL 15/19] .travis.yml: Run make check for all targets, not just some, Michael Tokarev, 2015/10/09
- [Qemu-trivial] [PULL 19/19] tests: Unique test path for /string-visitor/output, Michael Tokarev, 2015/10/09