From patchwork Tue Jun 12 10:58:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 928268 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vivier.eu Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 414n5x5KtKz9s1b for ; Tue, 12 Jun 2018 21:02:28 +1000 (AEST) Received: from localhost ([::1]:54484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSh4D-0005xS-3H for incoming@patchwork.ozlabs.org; Tue, 12 Jun 2018 07:02:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50202) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSh0l-0003Ru-Q0 for qemu-devel@nongnu.org; Tue, 12 Jun 2018 06:58:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSh0i-0007B9-VJ for qemu-devel@nongnu.org; Tue, 12 Jun 2018 06:58:51 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:45725) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSh0i-0007AC-MC for qemu-devel@nongnu.org; Tue, 12 Jun 2018 06:58:48 -0400 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue003 [212.227.15.167]) with ESMTPSA (Nemesis) id 0M5c8C-1gCqZQ3oXg-00xam1; Tue, 12 Jun 2018 12:58:37 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Tue, 12 Jun 2018 12:58:24 +0200 Message-Id: <20180612105831.25703-2-laurent@vivier.eu> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180612105831.25703-1-laurent@vivier.eu> References: <20180612105831.25703-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:sGO6qf86zbJiNFp0f5+VbsbMG6wqZxFU8XiT7Rzz6lswiwtznym jajogc4CgfV0EVDSFbZ823zszR2F+ZKOb5V1WHRACsVWTLD2miuGqISyRQpt9gp0JWCRVFE Fxa+QUfmyTSw5iA9T8OP4NhzXpFLS9TrJaoxd5owvJcsA6K8dUA6Wd90f+d3QNyR6HBhfMc AxiGNhbp7n4Rfh7mePu0Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:i9sOSL0NMxc=:osK7gzNgRyFQHZpG+gUpYy XL7doHuSN2t0SO9dWet+ILQxExMYyFQRcQ2WYQf5X3XILnG3LVPFdBIWm4vsvkw24oQ4/n/7S kTi7LZs9IcMRVANmAnPKjOvf9oxYfLu7WifC5ems2OSpNBkmYZIump4m0Iq97amezG3ykWtct q3qkjhNKK7kWLbX+0Nzr6GOxsQk99DimdYqwiV3ZyGrsW8gyuJBc1kutMh/D/f7VfFUI17Dtu gF4niB8Tf9F3twvF6utI3rgi4DTFzLDo2GSkuXWBieAP2C2hWIrM+9Y8scP+lK7dhCbOb+D/b 92Da0wEVt9O9NOKn89ef5Iw9Us7xtWcseNjpu8DeJq47GZkBERcp7fcioi3BpWL1k6vUTyyrd k9GI9BXrFmdK+m9eMog2HY5K3nCnodUbdTHLOjda+ZXoix7yBhMMAaDmsmCDxspup9sdgNc25 8w2qe4Ci6IQl14fNY6oD5qc7fYQVR3gMOvPA7wGTDAqV0NJBVCGtS1dzE311vQTsEdOtjYmrI T4NtooJe6LvC8ppboGSK78GTW2yncAcG+6mul3beVkutevZwGJl8t/Vc5teu5v+olzHNf9NRW ESgKVm6poj6G3vBR6Jv4+a1D5jTZU7URou6TWahEgFYsGwSLmIfoJWSI65LKmFDH224tAkGA/ a44ytmIO+FpTbj269Cv5c5pVzGGbwUU8FtPWVEysN2LFQX9sV32Ip9175GzMmICYv6/khAyDL h7wNZOvx1dtCKzcG X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.126.187 Subject: [Qemu-devel] [PULL 1/8] linux-user: Export use is_error(), use it to avoid warnings X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Riku Voipio , Laurent Vivier , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé 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é Reviewed-by: Laurent Vivier Message-Id: <20180604153722.24956-2-f4bug@amsat.org> Signed-off-by: Laurent Vivier --- 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 +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) {