From nobody Wed Feb 11 02:33:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1528127975283902.1479223259287; Mon, 4 Jun 2018 08:59:35 -0700 (PDT) Received: from localhost ([::1]:40578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPrtO-0001ZH-Gz for importer@patchew.org; Mon, 04 Jun 2018 11:59:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPrY4-00007d-FH for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fPrY3-00066S-Jr for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:37:32 -0400 Received: from mail-qt0-x244.google.com ([2607:f8b0:400d:c0d::244]:40028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fPrY3-00066M-Fy for qemu-devel@nongnu.org; Mon, 04 Jun 2018 11:37:31 -0400 Received: by mail-qt0-x244.google.com with SMTP id q6-v6so7098308qtn.7 for ; Mon, 04 Jun 2018 08:37:31 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id q5-v6sm14342276qkd.51.2018.06.04.08.37.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jun 2018 08:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u3waZ2Rwqek9lSHV+vru3Lt8biIgbawuCJ3dSGhnrow=; b=vEJz89iW0Omq3B2e8OZD1WaaxBfqdmTkGpmIFu42Jp9t2z3ataioSCPlV2A6hZt6UW MmS8rstlWaxCSpwFNLfp956SYF0JSyHaByeDoOJQMp0MZNw9xsWEq3US+cZvyZ9IiSVx /mIXoHnOYta37Cyz+4uoZo1vXzG7LA20zjDClUZJQk8CAWzlO5zCJWUxljhb9dywFMVN hldBrwNGaMYmTU6+aB7fGH2ExJDopuwm6xE1HoA0DW1+eSTPQ4El0F94ZLxW8uaj1tVQ mG+vL8Y9JD0tTNoVPnUJyuhFaWE1WWiKfzbGadI9smjYFFCBorjYXiYxosLrbJhCnkW0 vy8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=u3waZ2Rwqek9lSHV+vru3Lt8biIgbawuCJ3dSGhnrow=; b=H5UJ1Gl/7AGmWwV5+8UlCaCx4Br+oW8sqKx+Z+kacjrkk64HSokc3MZcZ3Bg7rlanP P9s9HwZLBdDuB7tKmiHgWX356tl9JQ0M6cH3hFC1pE2GujTDxX5q85PGVAhIQe5d42ZL OUfT+hju1ZA1Z1ynAzp12yf3shoLEuQV3yqhnytdWov57irvapVqVLQRwEw8FbrEUIXC NZmWSJ73Z/eLi1PvNGX6KvuHFl0YAuEslf+IY7q6/xav3opHL94LMp9Jn64ymEDk7kwn 4mzpY23hyz5UpPv0Yv9PIattG2I4hqAey11HV1g4HnN5HA/Nhe+c9BlWq5GUoEPabQ2K 37DA== X-Gm-Message-State: APt69E2vJtKQz1ozd0dM0WAu6kFoUvhsc5fMq5ImX9XCRuYbIAM6ymKn Ws/w9W40/7+Q6HB3pTmn+xCy8o0+ X-Google-Smtp-Source: ADUXVKJRKlKK5HRsBmLryNEhwCbYpNUf55jdSaLvJ7hw6SE+XX9MAF4VFDDFVlFxrbeyZbF5NN9ppQ== X-Received: by 2002:a0c:9ccb:: with SMTP id j11-v6mr20731644qvf.58.1528126651023; Mon, 04 Jun 2018 08:37:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Laurent Vivier Date: Mon, 4 Jun 2018 12:37:21 -0300 Message-Id: <20180604153722.24956-2-f4bug@amsat.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180604153722.24956-1-f4bug@amsat.org> References: <20180604153722.24956-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::244 Subject: [Qemu-devel] [PATCH RESEND v2 1/2] 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 , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9 Reviewed-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 c55c8e294b..4eeffe3c76 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -618,6 +618,11 @@ static inline void *lock_user_string(abi_ulong guest_a= ddr) =20 #include =20 +static inline int is_error(abi_long ret) +{ + return (abi_ulong)ret >=3D (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 d02c16bbc6..5e122dbdda 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; } =20 -static inline int is_error(abi_long ret) -{ - return (abi_ulong)ret >=3D (abi_ulong)(-4096); -} - const char *target_strerror(int err) { if (err =3D=3D TARGET_ERESTARTSYS) { --=20 2.17.1