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 B901DC433EF for ; Fri, 4 Feb 2022 10:49:02 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9433C83A45; Fri, 4 Feb 2022 11:49:00 +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="BJ0EOUoY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 587E183A57; Fri, 4 Feb 2022 11:48:59 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 6B8AC838C7 for ; Fri, 4 Feb 2022 11:48:56 +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 1714961A56; Fri, 4 Feb 2022 10:48:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CA49C004E1; Fri, 4 Feb 2022 10:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643971734; bh=xx3MNuUalwPpBJbQFJm2kXEMT384hfDyT20pJTDHYbE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BJ0EOUoY6EVmavFZDEL+GDtXlIqOygDFTnnEcfQdioUo5F+tfl96RZWvhsyuoTxKZ ivt9Rc88+x9wjN2NpXHVKd0K7HKYsg4NDLzcYAJrJC8OvY0qswsQU/P0EmEr7ynXkF +B4STPxfEvDeLOmvJfBo+JWeHnddnVKJnaBY/lDLlf/c1P6F5r91gao1Ag1d44c8Bh HSpiUjvNpmINIM5PbbKfh+nuAWkEn7lqIH50CTUxVt6m7qlIMwEwq3Npu+vG+xeG56 iuML10jtsGK/RrwV3SnwNI0TO+t+Hdfb/bPIzmBUdNpX467dxEr8JXLzQE8Cmz6K46 42fei3W7s1BWg== Received: by pali.im (Postfix) id 59D1AA80; Fri, 4 Feb 2022 11:48:51 +0100 (CET) Date: Fri, 4 Feb 2022 11:48:51 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Simon Glass Cc: Tom Rini , U-Boot Mailing List , Marek =?utf-8?B?QmVow7pu?= Subject: Re: [PATCH] malloc_simple: Remove usage of unsupported %zx format string Message-ID: <20220204104851.di2jof2bmagjqdfc@pali> References: <20220203185137.4469-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 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 On Thursday 03 February 2022 14:19:41 Simon Glass wrote: > Hi Pali, > > On Thu, 3 Feb 2022 at 11:51, Pali Rohár wrote: > > > > Replace %zx by %lx and cast size_t to ulong. > > > > U-Boot currently prints garbage debug output: > > size=x, ptr=18, limit=18: 4002a000 > > Do you mean in SPL? Yes, this is printed in 32-bit mvebu SPL. > > > > 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(-) > > > > Reviewed-by: Simon Glass > > > 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 > > > > Regards, > Simon