Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7563C432BE for ; Sun, 29 Aug 2021 22:51:40 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1B7FC60C3F for ; Sun, 29 Aug 2021 22:51:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1B7FC60C3F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F97D81FC6; Mon, 30 Aug 2021 00:51:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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=konsulko.com header.i=@konsulko.com header.b="rT1+6OBz"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FA678326C; Mon, 30 Aug 2021 00:51:35 +0200 (CEST) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (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 8360F8023C for ; Mon, 30 Aug 2021 00:51:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72b.google.com with SMTP id t190so13726164qke.7 for ; Sun, 29 Aug 2021 15:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cAZ46JjxvktjfxObMo+w+rCVgcgNm8mIllxC86HTw8w=; b=rT1+6OBzOOcR90ghDwmwFh5O1jmewTQwv6C/0Xcr2IPKBae7o6xeZzftg0Iez9xCWQ EUS4O+iGv2MIq1k0nZA1ecOvUdxy2odFznCNzJP0q9rW7BX8BPHhuwsJ3ePqZDK7mDXQ YOSJmXwObedN2zjq32p7R3NdELAyyIva+NHw0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cAZ46JjxvktjfxObMo+w+rCVgcgNm8mIllxC86HTw8w=; b=nBP+HhV0eOoJjM8T+7+si5RFAzXHmwac/wnyYlDmTC3ErMRnvFBc3IkQtruPv4iGSR 55MfNFYii7IjEgx7pXwUefP0zufG6B4XFnwpQaBl5zdvCSHLAIWJ8QsatV1oNrzyU7wd RK/zWsVnycbyDTQIVhhqjI5SPdg1a9SDrAFVn2F6ZhFk2srY6luBUHE9HHAuIPdcBIkh Ajz5GwG5Up7nmN2j+OdTdrNki7rGYWs0CO1e5QtJ4RpofSq0cnfkuioWfsn0lOv3E1Zl E6+B4TsQN5pl7FZ/zxpUYOu4HdIkXW6Cyz9D7qKoHzvWlFRjYkasDfux3RsgB4+jW+9C FZiw== X-Gm-Message-State: AOAM530Jp0pCEfasBNlHJFQ8FYWyWkx1dFcIurqsIiImaIqaOF34hnY5 oag2sr/5a29c8bWGSpXYtXBjEg== X-Google-Smtp-Source: ABdhPJxkE0AyvCNvQPTHDoPKtZZUJuQWpyXF2NIh/GH3JE4GM2kIHQ6UiebM0eWxohRoEHBO4oq7UQ== X-Received: by 2002:a05:620a:b0f:: with SMTP id t15mr19760793qkg.352.1630277489246; Sun, 29 Aug 2021 15:51:29 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-8054-417e-d97b-7576.res6.spectrum.com. [2603:6081:7b01:cbda:8054:417e:d97b:7576]) by smtp.gmail.com with ESMTPSA id j18sm10044348qkg.31.2021.08.29.15.51.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 29 Aug 2021 15:51:28 -0700 (PDT) Date: Sun, 29 Aug 2021 18:51:26 -0400 From: Tom Rini To: Marek Vasut Cc: u-boot@lists.denx.de, Simon Glass , Simon Goldschmidt Subject: Re: [PATCH 02/14] lmb: Use CONFIG_LMB_*_REGIONS only if they are defined Message-ID: <20210829225126.GM858@bill-the-cat> References: <20210815194721.GN858@bill-the-cat> <20210829180202.GG858@bill-the-cat> <20210829193239.GH858@bill-the-cat> <20210829221008.GK858@bill-the-cat> <0f735fc1-c331-ee13-4bbf-5be71d45fecd@denx.de> <20210829222356.GL858@bill-the-cat> <2cffb09e-23aa-afce-962e-1eb9727457db@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="c+T3cc4WSbZ2sb/v" Content-Disposition: inline In-Reply-To: <2cffb09e-23aa-afce-962e-1eb9727457db@denx.de> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean --c+T3cc4WSbZ2sb/v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 30, 2021 at 12:40:07AM +0200, Marek Vasut wrote: > On 8/30/21 12:23 AM, Tom Rini wrote: > > On Mon, Aug 30, 2021 at 12:19:59AM +0200, Marek Vasut wrote: > > > On 8/30/21 12:10 AM, Tom Rini wrote: > > > > On Sun, Aug 29, 2021 at 11:47:58PM +0200, Marek Vasut wrote: > > > > > On 8/29/21 9:32 PM, Tom Rini wrote: > > > > > > On Sun, Aug 29, 2021 at 09:24:46PM +0200, Marek Vasut wrote: > > > > > > > On 8/29/21 8:02 PM, Tom Rini wrote: > > > > > > > > On Sun, Aug 29, 2021 at 06:26:23PM +0200, Marek Vasut wrote: > > > > > > > > > On 8/15/21 9:47 PM, Tom Rini wrote: > > > > > > > > > > On Sun, Aug 15, 2021 at 08:13:02PM +0200, Marek Vasut w= rote: > > > > > > > > > >=20 > > > > > > > > > > > The CONFIG_LMB_*_REGIONS are defined only if CONFIG_L= MB is enabled, > > > > > > > > > > > protect access to those two config options to avoid u= ndefined macro > > > > > > > > > > > errors. > > > > > > > > > > >=20 > > > > > > > > > > > Signed-off-by: Marek Vasut > > > > > > > > > > > Cc: Simon Glass > > > > > > > > > > > Cc: Simon Goldschmidt > > > > > > > > > > > Cc: Tom Rini > > > > > > > > > > > --- > > > > > > > > > > > include/lmb.h | 4 ++-- > > > > > > > > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > > > >=20 > > > > > > > > > > > diff --git a/include/lmb.h b/include/lmb.h > > > > > > > > > > > index 3c4afdf9f0..fa1474a360 100644 > > > > > > > > > > > --- a/include/lmb.h > > > > > > > > > > > +++ b/include/lmb.h > > > > > > > > > > > @@ -44,7 +44,7 @@ struct lmb_property { > > > > > > > > > > > struct lmb_region { > > > > > > > > > > > unsigned long cnt; > > > > > > > > > > > unsigned long max; > > > > > > > > > > > -#if IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS) > > > > > > > > > > > +#if IS_ENABLED(CONFIG_LMB) && IS_ENABLED(CONFIG_LMB_= USE_MAX_REGIONS) > > > > > > > >=20 > > > > > > > > This doesn't make sense to me, still. You cannot enable > > > > > > > > CONFIG_LMB_USE_MAX_REGIONS without CONFIG_LMB as the former= depends on > > > > > > > > the latter in Kconfig. > > > > > > > >=20 > > > > > > > > > > > struct lmb_property region[CONFIG_LMB_MAX_REGI= ONS]; > > > > > > > > > > > #else > > > > > > > > > > > struct lmb_property *region; > > > > > > > > > > > @@ -67,7 +67,7 @@ struct lmb_region { > > > > > > > > > > > struct lmb { > > > > > > > > > > > struct lmb_region memory; > > > > > > > > > > > struct lmb_region reserved; > > > > > > > > > > > -#if !IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS) > > > > > > > > > > > +#if IS_ENABLED(CONFIG_LMB) && !IS_ENABLED(CONFIG_LMB= _USE_MAX_REGIONS) > > > > > > > > > > > struct lmb_property memory_regions[CONFIG_LMB_= MEMORY_REGIONS]; > > > > > > > > > > > struct lmb_property reserved_regions[CONFIG_LM= B_RESERVED_REGIONS]; > > > > > > > > > > > #endif > > > > > > > > > >=20 > > > > > > > > > > We shouldn't need this at all. LMB and LMB_USE_MAX_REG= IONS are both in > > > > > > > > > > Kconfig and have the dependencies expressed that way. > > > > > > > > >=20 > > > > > > > > > However, CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVE= D_REGIONS may be > > > > > > > > > undefined if CONFIG_LMB and !CONFIG_LMB_USE_MAX_REGIONS .= They are four > > > > > > > > > different symbols. > > > > > > > >=20 > > > > > > > > I'm still not seeing it, sorry. Is there some case where w= e're trying > > > > > > > > to access a struct lmb without CONFIG_LMB enabled? > > > > > > > >=20 > > > > > > >=20 > > > > > > > See build failure > > > > > > > https://source.denx.de/u-boot/custodians/u-boot-sh/-/jobs/315= 331 > > > > > >=20 > > > > > > Ah, progress. Drop from since we already hav= e a > > > > > > forward declaration of struct lmb? But it's not failing withou= t this > > > > > > series too, so what's changing? > > > > >=20 > > > > > See 01/14 in this series. > > > >=20 > > > > Ah, so drop 1/14 then. > > >=20 > > > Why ? That patch is correct. > >=20 > > It's not quite right, 1/14 and then 2/14 are papering over the fact that > > lmb.h, and it's including headers / files, need to be cleaned up so that > > we don't need to have redundant tests in the header. >=20 > 1/14 disables LMB and CMD_BDI for tools build, we do not need those, so 1= /14 > is correct. We don't need to build u-boot at all for tools-only, only the tools-only build target. It's just annoying to exclude the tools-only_defconfig from "sandbox" in CI. > What kind of cleanup of lmb.h do you have in mind ? Remove it from include/image.h and fix any fall-out from that of files that got indirectly when they needed it directly instead. --=20 Tom --c+T3cc4WSbZ2sb/v Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmEsD2oACgkQFHw5/5Y0 tyzsWgv9GQdxud8oPowIliGyIGY48pjq49WTnPagpIWU2CLAR+8X5WmabRtptblF vDlnG1GTWQblHnkPMVLPv5+lNvtYJuX1vVXr0WiseISH88LXWAFTXNJxvk2Zkvjt i/AF2RGBQq+PWaFGqMEBJpQ6gk2u+4kgrlm+yPk54v9oa41YphfBNqDfqvXKVqSx el4WC0mFyZ9oiji6BNSeb/6G3R6NWn3Qh6btt5pqVi+j3zPsazYfY3jy1lSfMed9 Xu1lZetzoUFfh9crjmf2lUwbvIveCtq7EKKwAW9P9X8jew07M9Ou+MPyzwwrrZ9f l3Ks4arXWnisJ3nzxLG/CgbGRB/wRTpNeJCGrkNHlhyy1ETUn1xNOy3zMGdJFc4W muFHbQoGglt+eeejEyRH2Ccd1sd77PlgIbl+o45Bouz/x/IrZm6hofSNgol5O7hY HsKxOrwk0ECkRhEyDx3Hx9HYrS1UT+9t4K7Q3C3NQzOAhskF1vfXIZ024qe4W6aX mIe6khqy =QMma -----END PGP SIGNATURE----- --c+T3cc4WSbZ2sb/v--