[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/8] linux-user: Export use is_error(), use it to avo
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PULL 1/8] linux-user: Export use is_error(), use it to avoid warnings |
Date: |
Tue, 12 Jun 2018 12:58:24 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
This fixes:
linux-user/flatload.c:740:9: warning: Loss of sign in implicit conversion
if (res > (unsigned long)-4096)
^~~
Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Laurent Vivier <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
linux-user/qemu.h | 5 +++++
linux-user/syscall.c | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 6fa1e968db..793cd4df04 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -618,6 +618,11 @@ static inline void *lock_user_string(abi_ulong guest_addr)
#include <pthread.h>
+static inline int is_error(abi_long ret)
+{
+ return (abi_ulong)ret >= (abi_ulong)(-4096);
+}
+
/* Include target-specific struct and function definitions;
* they may need access to the target-independent structures
* above, so include them last.
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 7b9ac3b408..2117fb13b4 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -906,11 +906,6 @@ static inline abi_long get_errno(abi_long ret)
return ret;
}
-static inline int is_error(abi_long ret)
-{
- return (abi_ulong)ret >= (abi_ulong)(-4096);
-}
-
const char *target_strerror(int err)
{
if (err == TARGET_ERESTARTSYS) {
--
2.14.4
- [Qemu-devel] [PULL 0/8] Linux user for 3.0 patches, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 1/8] linux-user: Export use is_error(), use it to avoid warnings,
Laurent Vivier <=
- [Qemu-devel] [PULL 3/8] linux-user: disable qemu-bridge-helper and socket_scm_helper build, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 4/8] qemu-binfmt-conf.sh: ignore the OS/ABI field, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 5/8] linux-user/alpha: Fix epoll syscalls, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 8/8] linux-user/sparc64: Add inotify_rm_watch and tee syscalls, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 2/8] linux-user: Use is_error() to avoid warnings and make the code clearer, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 7/8] linux-user/microblaze: Fix typo in accept4 syscall, Laurent Vivier, 2018/06/12
- [Qemu-devel] [PULL 6/8] linux-user/hppa: Fix typo in mknodat syscall, Laurent Vivier, 2018/06/12
- Re: [Qemu-devel] [PULL 0/8] Linux user for 3.0 patches, no-reply, 2018/06/12
- Re: [Qemu-devel] [PULL 0/8] Linux user for 3.0 patches, Peter Maydell, 2018/06/14