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 X-Spam-Level: X-Spam-Status: No, score=-17.8 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,NICE_REPLY_A,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 46E4BC432BE for ; Sun, 29 Aug 2021 22:40:14 +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 D405260E77 for ; Sun, 29 Aug 2021 22:40:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D405260E77 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 1067A83332; Mon, 30 Aug 2021 00:40:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1630276811; bh=eb5+ehvIXOOMUKIOrCb8KDqli7pwYGqoZ2sMIuGqNsA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=x8+M6wfLVJncpe7Ae28sKjwtIGHN5oLJSBfTbceiwbPtiR1KExCIjpU0YXMCqpfrG veFEbyrkKMfr4msLU0lpXkpX8xGjj1pCamlNfrfCCI6MmGVhGYYvGSvHQE51jA8e48 U2Ad61uZXAjm1suf0ShBxFtu1ZAukmDENcyQQr2re/4q2sNoJUQLAhnFaaa0+6xmlT /Z9B/9gQWFOsu4dl0UYeKs/sVzZ77Zxf3Ya7fXaD3vif53Ff7xSCaHJ1P8ahswoJyF pyk644QLTPOicYXYOBtCKvXc1vKMBlqPrkpCiDF/l5knDYSe4E7wKjER5fbItZer77 RQ7vh+YUUmbCA== Received: from [IPv6:::1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 50A5683332; Mon, 30 Aug 2021 00:40:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1630276808; bh=eb5+ehvIXOOMUKIOrCb8KDqli7pwYGqoZ2sMIuGqNsA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=klz3KVUaKJLdDLVllvM8RVEKn3qv5vW4kv393U4czhJpfoTx9BPcgwFCrjnHFls3D pAOw5yzJ7X0AULsVlLv9R8ohwFN3u+cQcAtn90FpfLAk8HXxHhzwe/z2d8fI3DGfVl L3X5eBFE+a00+9TXYglfpezy/A5X8BstxWTpU5mIERaVHXBH3IMtGJwhhs8P2dUGVj mSk4Gd0A6i4wwLeEhj2zwMRbQof2TZ60Ielws37AKvKFfABBzSDubEIqLy17QnAwgX IXM9K0QDzErmomxLRCVvmOw0Ip81ROHl+chC9Ucqb1FnHuS1slULzDxRC3db4znTz5 Ucyqtsoct4LKg== Subject: Re: [PATCH 02/14] lmb: Use CONFIG_LMB_*_REGIONS only if they are defined To: Tom Rini Cc: u-boot@lists.denx.de, Simon Glass , Simon Goldschmidt References: <20210815181314.132330-1-marek.vasut+renesas@gmail.com> <20210815181314.132330-2-marek.vasut+renesas@gmail.com> <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> From: Marek Vasut Message-ID: <2cffb09e-23aa-afce-962e-1eb9727457db@denx.de> Date: Mon, 30 Aug 2021 00:40:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210829222356.GL858@bill-the-cat> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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 wrote: >>>>>>>>> >>>>>>>>>> The CONFIG_LMB_*_REGIONS are defined only if CONFIG_LMB is enabled, >>>>>>>>>> protect access to those two config options to avoid undefined macro >>>>>>>>>> errors. >>>>>>>>>> >>>>>>>>>> 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(-) >>>>>>>>>> >>>>>>>>>> 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) >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>>>>> struct lmb_property region[CONFIG_LMB_MAX_REGIONS]; >>>>>>>>>> #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_LMB_RESERVED_REGIONS]; >>>>>>>>>> #endif >>>>>>>>> >>>>>>>>> We shouldn't need this at all. LMB and LMB_USE_MAX_REGIONS are both in >>>>>>>>> Kconfig and have the dependencies expressed that way. >>>>>>>> >>>>>>>> However, CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVED_REGIONS may be >>>>>>>> undefined if CONFIG_LMB and !CONFIG_LMB_USE_MAX_REGIONS . They are four >>>>>>>> different symbols. >>>>>>> >>>>>>> I'm still not seeing it, sorry. Is there some case where we're trying >>>>>>> to access a struct lmb without CONFIG_LMB enabled? >>>>>>> >>>>>> >>>>>> See build failure >>>>>> https://source.denx.de/u-boot/custodians/u-boot-sh/-/jobs/315331 >>>>> >>>>> Ah, progress. Drop from since we already have a >>>>> forward declaration of struct lmb? But it's not failing without this >>>>> series too, so what's changing? >>>> >>>> See 01/14 in this series. >>> >>> Ah, so drop 1/14 then. >> >> Why ? That patch is correct. > > 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. 1/14 disables LMB and CMD_BDI for tools build, we do not need those, so 1/14 is correct. What kind of cleanup of lmb.h do you have in mind ?