From patchwork Wed Jul 12 17:07:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1806911 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=s1 header.b=YEQ/LPxR; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R1PMB6nfnz20Ph for ; Thu, 13 Jul 2023 03:08:06 +1000 (AEST) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 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: TdbjyGynYnRZWhH+7lKUQJL+ZxmxpowvO2O9SQF5CwCVrYgcwUXgU5DKUU3QxAfZekEeQsTe+RrMu3cja6a0hwolg4jgZVapoGt8GbPKX4K5ErnbkkY5YDlbNkQ6EAYFeNIi4JBiJQwweooSPLidx9vWbdAuMfdpmOxwst2gqytc+rEQQAeofaBZJqn2DX16F2rDgwQOUc/DsI0W2mBbKMSWXfSxrnu4ZoXkGkcyZBac8I1wVrh0ZYZ1uAOhhJP1 To: Kever Yang , Simon Glass , Philipp Tomsich Cc: Stefan Agner , u-boot@lists.denx.de, Jonas Karlman X-Entity-ID: P7KYpSJvGCELWjBME/J5tg== 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';