diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2018-06-04 12:37:21 -0300 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2018-06-11 14:40:11 +0200 |
commit | 1129dd712157b42397275681e6397bf2d6bdfa0e (patch) | |
tree | 5b2c920910db043477d994739d2efd08b840ec34 | |
parent | 9f55925b8f50a962d1d08d815044db7767ae3838 (diff) |
linux-user: Export use is_error(), use it to avoid warnings
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é <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180604153722.24956-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
-rw-r--r-- | linux-user/qemu.h | 5 | ||||
-rw-r--r-- | 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) { |