aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Chotard <patrice.chotard@foss.st.com>2022-08-02 10:21:35 +0200
committerTom Rini <trini@konsulko.com>2022-08-10 13:38:30 -0400
commit5e2548c1d6e0331edbf94edcfc95d55b5e9a6cab (patch)
tree688a7495be70cf38dd466eed66dddc8e8f8e4efd
parentc252fa5cdbb421bbcca750866e5c5f9f6c8c1c34 (diff)
downloadu-boot-5e2548c1d6e0331edbf94edcfc95d55b5e9a6cab.zip
u-boot-5e2548c1d6e0331edbf94edcfc95d55b5e9a6cab.tar.gz
u-boot-5e2548c1d6e0331edbf94edcfc95d55b5e9a6cab.tar.bz2
lmb: Fix LMB_MEMORY_REGIONS flag usage
This patch is fixing a broken boot observed on stm32mp157c-dk2 board. IS_ENABLED macro should be used to check if a compilation flag is set to "y" or "m". LMB_MEMORY_REGIONS is set to a numerical value, IS_ENABLED macro is not suitable in this case. Fixes: 7c1860fce4e3 ("lmb: Fix lmb property's defination under struct lmb") Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Acked-by: Michal Simek <michal.simek@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
-rw-r--r--include/lmb.h2
-rw-r--r--lib/lmb.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/lmb.h b/include/lmb.h
index 1476d78..7298c2c 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -68,7 +68,7 @@ struct lmb_region {
struct lmb {
struct lmb_region memory;
struct lmb_region reserved;
-#if IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
+#ifdef CONFIG_LMB_MEMORY_REGIONS
struct lmb_property memory_regions[CONFIG_LMB_MEMORY_REGIONS];
struct lmb_property reserved_regions[CONFIG_LMB_RESERVED_REGIONS];
#endif
diff --git a/lib/lmb.c b/lib/lmb.c
index f21fe67..c599608 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -108,7 +108,7 @@ void lmb_init(struct lmb *lmb)
#if IS_ENABLED(CONFIG_LMB_USE_MAX_REGIONS)
lmb->memory.max = CONFIG_LMB_MAX_REGIONS;
lmb->reserved.max = CONFIG_LMB_MAX_REGIONS;
-#elif IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
+#elif defined(CONFIG_LMB_MEMORY_REGIONS)
lmb->memory.max = CONFIG_LMB_MEMORY_REGIONS;
lmb->reserved.max = CONFIG_LMB_RESERVED_REGIONS;
lmb->memory.region = lmb->memory_regions;