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 06755EB64D9 for ; Mon, 10 Jul 2023 14:49:41 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 75F46866D2; Mon, 10 Jul 2023 16:49:39 +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 3C107866D4; Mon, 10 Jul 2023 16:49:38 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 65BF4866BF for ; Mon, 10 Jul 2023 16:49:35 +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 938022B; Mon, 10 Jul 2023 07:50:16 -0700 (PDT) Received: from e130802.arm.com (unknown [10.57.34.188]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 499683F740; Mon, 10 Jul 2023 07:49:33 -0700 (PDT) Date: Mon, 10 Jul 2023 15:49:28 +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: <20230710144928.GA228038@e130802.arm.com> References: <20230707144410.228472-1-abdellatif.elkhlifi@arm.com> <20230707144410.228472-6-abdellatif.elkhlifi@arm.com> <20230710121451.GA139406@e130802.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 Mon, Jul 10, 2023 at 08:17:41AM -0600, Simon Glass wrote: > Hi Abdellatif, > > On Mon, 10 Jul 2023 at 06:15, Abdellatif El Khlifi > wrote: > > > > 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"). > > Yes, the ll looks right. I was referring to the "" line. > > > > > 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} > > Hmm I was hoping that we could use ll for 64-bit and l for 32-bit and > that this could be a generic header for all archs. The "" was there for 32-bit architecures (e.g: sandbox, mips) who declare "phys_addr_t" as u32 or "unsigned int" For example, when using sandbox with "l" in place of "", there is a compiler warning: cmd/armffa.c:174:11: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘phys_addr_t’ {aka ‘unsigned int’} - Wformat=] 174 | log_info("device %s, addr " PHYS_ADDR_LN ", driver %s, ops " PHYS_ADDR_LN "\n", > > Can we get your series in as is and deal with this separately. I was > intending for this to be a follow-up patch. Sounds good to me. I'll move this commit out of the FF-A patchset and define PHYS_ADDR_LN in armffa.c to be used only there. Is that ok ? Cheers, Abdellatif