[PATCH v2 1/2] lmb: Fix LMB_MEMORY_REGIONS flag usage

Tom Rini trini at konsulko.com
Fri Apr 7 16:50:54 CEST 2023


On Wed, Mar 22, 2023 at 07:12:25PM +0100, Patrick Delaunay wrote:

> Remove test on CONFIG_LMB_MEMORY_REGIONS introduced by commit
> 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb").
> 
> This code in lmb_init() is strange, because if CONFIG_LMB_USE_MAX_REGIONS
> and CONFIG_LMB_MEMORY_REGIONS are not defined, the implicit #else is empty
> and the required initialization is not done:
> lmb->memory.max = ?
> lmb->reserved.max = ?
> 
> But this setting is not possible:
> - CONFIG_LMB_USE_MAX_REGIONS not defined
> - CONFIG_LMB_MEMORY_REGIONS not defined
> because CONFIG_LMB_MEMORY_REGIONS and CONFIG_LMB_RESERVED_REGIONS are
> defined as soon as the CONFIG_LMB_USE_MAX_REGIONS is not defined.
> 
> This patch removes this impossible case #elif and I add some
> explanation in lmb.h to explain why in the struct lmb {} the lmb
> property is defined if CONFIG_LMB_MEMORY_REGIONS is NOT defined.
> 
> This patch also removes CONFIG_LMB_XXX dependency on CONFIG_LMB as these
> defines are used in API file lmb.h and not only in library file.
> 
> Fixes: 5e2548c1d6e03 ("lmb: Fix LMB_MEMORY_REGIONS flag usage")
> Reported-by: Mark Millard <marklmi at yahoo.com>
> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
> Acked-by: Michal Simek <michal.simek at amd.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230407/2c8c7947/attachment.sig>


More information about the U-Boot mailing list