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 E1896C433F5 for ; Thu, 3 Feb 2022 18:51:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F1DB9838C4; Thu, 3 Feb 2022 19:51:52 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="jeqjM2o2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6CD97838F9; Thu, 3 Feb 2022 19:51:51 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E78B5838BF for ; Thu, 3 Feb 2022 19:51:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 22D6E61924; Thu, 3 Feb 2022 18:51:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69BB9C340E8; Thu, 3 Feb 2022 18:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643914306; bh=1pdDDPMxT877AcT0yBz8TjxCCaspAtANskHwHxQ3cNE=; h=From:To:Cc:Subject:Date:From; b=jeqjM2o2qwH+epCJHxzcNwW+9MPhyJ9G2Zon/i4bsU4Y0Wyv2lwtz2Rib8axVe96p CmCpV7BMUFIDCGUS5xaDn+LFjjwPVXgEj1JAWm+UZMSE8IM8DTXQ+cS0MsFSWbQepi ZX6bLCTszLd6ZxbkQs+N7UZ5ge6k/8nyBfSDGpYT8bTcYZ/vrT3d+dxDWl3T9Ci0Lp Og37sxtVd8IWyc32OL0UoJ1NPa3Kmp7Mflj8tcCjBUw6h8rCbnHPkXb3grj2okuhxh /H8HDlV0S/3uJ/XPxj3R+QLEaTzo/J/FDehGx/DVGqEw2+d1zDVgVopTXL2ROFjL85 RPhJJ8kF2cAfQ== Received: by pali.im (Postfix) id 1E23C889; Thu, 3 Feb 2022 19:51:44 +0100 (CET) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: Simon Glass , Tom Rini Cc: u-boot@lists.denx.de, =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH] malloc_simple: Remove usage of unsupported %zx format string Date: Thu, 3 Feb 2022 19:51:37 +0100 Message-Id: <20220203185137.4469-1-pali@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean Replace %zx by %lx and cast size_t to ulong. U-Boot currently prints garbage debug output: size=x, ptr=18, limit=18: 4002a000 With this change it prints correct debug data: size=18, ptr=18, limit=2000: 4002a000 Signed-off-by: Pali Rohár --- common/malloc_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/malloc_simple.c b/common/malloc_simple.c index 0267fb6bec87..67ee623850e0 100644 --- a/common/malloc_simple.c +++ b/common/malloc_simple.c @@ -23,7 +23,7 @@ static void *alloc_simple(size_t bytes, int align) addr = ALIGN(gd->malloc_base + gd->malloc_ptr, align); new_ptr = addr + bytes - gd->malloc_base; - log_debug("size=%zx, ptr=%lx, limit=%lx: ", bytes, new_ptr, + log_debug("size=%lx, ptr=%lx, limit=%lx: ", (ulong)bytes, new_ptr, gd->malloc_limit); if (new_ptr > gd->malloc_limit) { log_err("alloc space exhausted\n"); -- 2.20.1