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 CB046C001DC for ; Wed, 12 Jul 2023 17:08:03 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DE24586B6F; Wed, 12 Jul 2023 19:07:40 +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="YEQ/LPxR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F21BB86B56; Wed, 12 Jul 2023 19:07:37 +0200 (CEST) Received: from s.wrqvtzvf.outbound-mail.sendgrid.net (s.wrqvtzvf.outbound-mail.sendgrid.net [149.72.126.143]) (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 BB80186AEE for ; Wed, 12 Jul 2023 19:07:35 +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=f9C3+5JZHJYTC3llnVmWPd4G04QnjnJq4X1jhhVnY8o=; b=YEQ/LPxRruxKjkfcjyTT3WsJyDms0y1PYem5iNgiBlJ4HM8c8sBDCiFLP+ypdopbpFa2 3HYa76EHIAlFRB5dzkLYxUs+l+0xtz2zVfRfgjnHEGcc5E4WJzCZcCYS/HX+Owv+Eg5aDv BLC+tF20/BORmLXQlrf1v5HNMPi+h+BQt1l/IgRYBp+U//d4scYQvQEm+1oUJwiEift8mx raFzrgUQztVXXdL+qEsTnEcn5g+3aKyNaDs9OoYaMN2Ob9sKTwItT8ZkoBoFkhRY32A6p0 4r9cmx91q/XIOvtdzETv1sXH2po+/v3d2oTJvMoP5fHNT8/AS1H/fu2LIAMD5LZQ== Received: by filterdrecv-8684c58db7-nfltn with SMTP id filterdrecv-8684c58db7-nfltn-1-64AEDDD5-E 2023-07-12 17:07:33.306425857 +0000 UTC m=+5419741.584598452 Received: from bionic.localdomain (unknown) by geopod-ismtpd-10 (SG) with ESMTP id FTl5YusgQbibj14zyAPvcg Wed, 12 Jul 2023 17:07:33.017 +0000 (UTC) From: Jonas Karlman Subject: [PATCH v2 2/3] cmd: ini: Fix build warning Date: Wed, 12 Jul 2023 17:07:33 +0000 (UTC) Message-ID: <20230712170729.18406-3-jonas@kwiboo.se> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230712170729.18406-1-jonas@kwiboo.se> References: <20230712170729.18406-1-jonas@kwiboo.se> MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxA?= =?us-ascii?Q?fZekEeQsTe+RrMu3cja6a0hwolg4jgZVapoGt8G?= =?us-ascii?Q?bPKX4K5ErnbkkY5YDlbNkQ6EAYFeNIi4JBiJQww?= =?us-ascii?Q?eooSPLidx9vWbdAuMfdpmOxwst2gqytc+rEQQAe?= =?us-ascii?Q?ofaBZJqn2DX16F2rDgwQOUc=2FDsI0W2mBbKMSWXf?= =?us-ascii?Q?Sxrnu4ZoXkGkcyZBac8I1wVrh0ZYZ1uAOhhJP1?= 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 --- 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