From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F845EB64DA for ; Sat, 22 Jul 2023 14:02:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1F6E0861DA; Sat, 22 Jul 2023 16:02:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.b="Xtok0D1d"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E959D863D5; Sat, 22 Jul 2023 16:02:17 +0200 (CEST) Received: from s.wrqvtbkv.outbound-mail.sendgrid.net (s.wrqvtbkv.outbound-mail.sendgrid.net [149.72.123.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 97CAF8622C for ; Sat, 22 Jul 2023 16:02:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bounces+31435339-7456-u-boot=lists.denx.de@em2124.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type:cc:content-type:from:subject:to; s=s1; bh=Mbem1lvvcXi1mLAeCdBMBGZW3roJYmONpgraV+LZZ54=; b=Xtok0D1dA+ipEmQa5n/xxJCbONZ+/SbqYJqR/JopZMRIsihYo0xs8AHwO6hGrLXRw81M lQh5fAvxKHfmlpZcFbAcI0cawPT6zLjzWzBvMlWLlv6xiWoR1zmo8hL4pPYARHrf/4V/ds Hcj4a3ekjU0uXRZTwLi5+b32wa5l8fd+lN1mKfBv7TBocxytntjW7G8B/1bDpVB2Fh5rS7 mIbe4k43FLSFuneJg3AKqkgeEYNDWVpDCq9mj1QTyus1Kvi7mf0NflJ8iEFlFfM+xvhyjJ T9oivAPC1cb+7YIRnFf6BSHToD0UzaEB0VW9dABn1PamPMyt5zPY0ZjLoWIj8yQQ== Received: by filterdrecv-d7bbbc8bf-w9ffg with SMTP id filterdrecv-d7bbbc8bf-w9ffg-1-64BBE164-CF 2023-07-22 14:02:13.001756372 +0000 UTC m=+6272555.767740491 Received: from bionic.localdomain (unknown) by geopod-ismtpd-0 (SG) with ESMTP id Bfe2QXSSQ9OLrjR8PXd2sA Sat, 22 Jul 2023 14:02:12.816 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v3 2/3] cmd: ini: Fix build warning Date: Sat, 22 Jul 2023 14:02:13 +0000 (UTC) Message-ID: <20230722140209.1897117-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230722140209.1897117-1-jonas@kwiboo.se> References: <20230722140209.1897117-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0h6tjzKZKlGIOVVnM4?= =?us-ascii?Q?b4QwNl=2F2DcwHTHAd0K4rF2f35hJYxwp7NGCKO2d?= =?us-ascii?Q?u3It25wMz34Px61zEANyw2DuWMKZ2y03VObQlHZ?= =?us-ascii?Q?EEMAaMgOTJRNqjr05cqyZ6tlajEEgVO3rMVrJgl?= =?us-ascii?Q?KNZDR5P8Q05h7KPPfCugmPGrEWCEPP0Shq=2FjhG?= To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Stefan Agner , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Building U-Boot with CMD_INI=y result in following build warning: cmd/ini.c: In function 'memgets': include/linux/kernel.h:184:24: warning: comparison of distinct pointer types lacks a cast 184 | (void) (&_min1 == &_min2); \ | ^~ cmd/ini.c:92:15: note: in expansion of macro 'min' 92 | len = min((end - *mem) + newline, num); | ^~~ Fix this by adding an int cast to the pointer arithmetic result. Signed-off-by: Jonas Karlman --- v3: - No changes v2: - New patch cmd/ini.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ini.c b/cmd/ini.c index 81dfc4c4e83d..35de2373e602 100644 --- a/cmd/ini.c +++ b/cmd/ini.c @@ -89,7 +89,7 @@ static char *memgets(char *str, int num, char **mem, size_t *memsize) end = *mem + *memsize; newline = 0; } - len = min((end - *mem) + newline, num); + len = min((int)(end - *mem) + newline, num); memcpy(str, *mem, len); if (len < num) str[len] = '\0'; -- 2.41.0