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 171B8EB64DC for ; Mon, 10 Jul 2023 19:46:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5AF786779; Mon, 10 Jul 2023 21:46:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cophLqUS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6881986783; Mon, 10 Jul 2023 21:46:02 +0200 (CEST) Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 A0880800D2 for ; Mon, 10 Jul 2023 21:45:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4f766777605so7658065e87.1 for ; Mon, 10 Jul 2023 12:45:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689018359; x=1691610359; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Aeg+3I6r0Pr92RqYP9pUnMX/wlA00W2ldmB8OcQzo5w=; b=cophLqUSPC5uD1P1ukQrecZnfWbsnXsA1EewzXdfxG2lbXFSy5p7LxaA55qJXN+QMk WxgZpGxu4q4l5fSQ8WunwVlcS/3GIfeehMVZpVwB03JRx8UVokis+781FrMXZg8IGJcy CF7zjlCeXhFUWAtgw077a/CxF9kpcmOe4+cxU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689018359; x=1691610359; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Aeg+3I6r0Pr92RqYP9pUnMX/wlA00W2ldmB8OcQzo5w=; b=Y91BX3XgfCv0IcL8k716dui5kMeUPqEemzPPrV1kgS74QhjPW2vW7e/SJIVdOW8iry YQICwM9lG/1slCjSWrlL6MjdT+pir3nN7c9B43XW+Hehk8yYvswlISxV+s7ZECcTJWXi GzlBvgWCgHzKQeExcHTNOWmW7SzwClbsfpAFOBfpAr1P6sJzA9mUUFu2kRMlmavUwRgf pgTNr3pVqFhCdklIDbpSR6j3M4MWUavab9BE7rkMvVr1tWMVkX///sitymj/e41xlGiX RDTEDsfTCZ9RW05HsS4j0lUf/sdtp6fCSWwAJzO3juvIEWZr+ToM/I2znaMwpL0AsC44 LpjA== X-Gm-Message-State: ABy/qLZU9yRvuE8WxQv8pmL+5piCvC183lLEs/9yhuNpqi/Pm9nfii/P ARzIhfUlHjL4Z/yBqaArgk4eco7456e5Nss/T7KI2g== X-Google-Smtp-Source: APBJJlGj2y7pBaTJYEo6zJexzhQcSqgrWX5QPTfgEt9ndbftAPVPgCfxjVv8o+3HPaajqh5p4qVca3ZRf+fWXwJ4HO4= X-Received: by 2002:ac2:4d87:0:b0:4f8:75af:e917 with SMTP id g7-20020ac24d87000000b004f875afe917mr10244281lfe.41.1689018358605; Mon, 10 Jul 2023 12:45:58 -0700 (PDT) MIME-Version: 1.0 References: <20230707144410.228472-1-abdellatif.elkhlifi@arm.com> <20230707144410.228472-6-abdellatif.elkhlifi@arm.com> <20230710121451.GA139406@e130802.arm.com> <20230710144928.GA228038@e130802.arm.com> In-Reply-To: <20230710144928.GA228038@e130802.arm.com> From: Simon Glass Date: Mon, 10 Jul 2023 13:45:45 -0600 Message-ID: Subject: Re: [PATCH v14 05/11] log: select physical address formatting in a generic way To: Abdellatif El Khlifi Cc: nd@arm.com, u-boot@lists.denx.de Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Abdellatif, On Mon, 10 Jul 2023 at 08:49, Abdellatif El Khlifi wrote: > > 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-b= it) > > > > > > > > > > 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(voi= d) > > > > > (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 "un= signed 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 =E2=80=98%lx=E2=80=99 expects ar= gument of type =E2=80=98long unsigned int=E2=80=99, but argument 3 has type= =E2=80=98phys_addr_t=E2=80=99 {aka =E2=80=98long long unsign > > > ed int=E2=80=99} [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Optio= ns.html#index-Wformat=3D-Wformat=3D8;;] > > > 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 comp= iler warning: > > cmd/armffa.c:174:11: warning: format =E2=80=98%lx=E2=80=99 expects argume= nt of type =E2=80=98long unsigned int=E2=80=99, but argument 8 has type =E2= =80=98phys_addr_t=E2=80=99 {aka =E2=80=98unsigned int=E2=80=99} - > Wformat=3D] > 174 | log_info("device %s, addr " PHYS_ADDR_LN ", driver %s, ops " PHY= S_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 def= ine PHYS_ADDR_LN in armffa.c to be used only there. > > Is that ok ? It's fine with me. Regards, Simon