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 3D89DEB64DA for ; Mon, 10 Jul 2023 12:15:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF73D8663F; Mon, 10 Jul 2023 14:15:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 547E28664F; Mon, 10 Jul 2023 14:15:00 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id B9930861DA for ; Mon, 10 Jul 2023 14:14:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=abdellatif.elkhlifi@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 581BE2B; Mon, 10 Jul 2023 05:15:39 -0700 (PDT) Received: from e130802.arm.com (unknown [10.57.34.188]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2E56E3F67D; Mon, 10 Jul 2023 05:14:55 -0700 (PDT) Date: Mon, 10 Jul 2023 13:14:51 +0100 From: Abdellatif El Khlifi To: Simon Glass Cc: nd@arm.com, u-boot@lists.denx.de Subject: Re: [PATCH v14 05/11] log: select physical address formatting in a generic way Message-ID: <20230710121451.GA139406@e130802.arm.com> References: <20230707144410.228472-1-abdellatif.elkhlifi@arm.com> <20230707144410.228472-6-abdellatif.elkhlifi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Hi Simon, On Fri, Jul 07, 2023 at 06:34:14PM +0100, Simon Glass wrote: > Hi Abdellatif, > > On Fri, 7 Jul 2023 at 15:44, Abdellatif El Khlifi > wrote: > > > > sets the log formatting according to the platform (64-bit vs 32-bit) > > > > Signed-off-by: Abdellatif El Khlifi > > Cc: Simon Glass > > --- > > include/log.h | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/include/log.h b/include/log.h > > index 3bab40b617..689cef905b 100644 > > --- a/include/log.h > > +++ b/include/log.h > > @@ -686,4 +686,12 @@ static inline int log_get_default_format(void) > > (IS_ENABLED(CONFIG_LOGF_FUNC) ? BIT(LOGF_FUNC) : 0); > > } > > > > +/* Select the right physical address formatting according to the platform */ > > +#ifdef CONFIG_PHYS_64BIT > > +#define PhysAddrLength "ll" > > +#else > > +#define PhysAddrLength "" > > Shouldn't this be "l" ? We normally use ulong for addresses. > The "ll" is needed by many architectures who declare "phys_addr_t" as "unsigned long long" Example of architetures doing that: arm, powerpc, ... Also mips and sandbox use "u64" for "phys_addr_t" , ( "u64" is an "unsigned long long"). Note: When using an "l" for arm, the compiler shows this warning: cmd/armffa.c:174:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘phys_addr_t’ {aka ‘long long unsign ed int’} [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wformat=-Wformat=8;;] 174 | log_info("device %s, addr " PHYS_ADDR_LN ", driver %s, ops " PHYS_ADDR_LN "\n", | ^~~~~~~~~~~~~~~~~~ 175 | dev->name, 176 | map_to_sysmem(dev), | ~~~~~~~~~~~~~~~~~~ | | | phys_addr_t {aka long long unsigned int} Cheers, Abdellatif