]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lmb: Fix lmb property's defination under struct lmb
authorAshok Reddy Soma <ashok.reddy.soma@xilinx.com>
Thu, 7 Jul 2022 08:45:36 +0000 (10:45 +0200)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 06:23:54 +0000 (08:23 +0200)
Under struct lmb {} the lmb property's should be defined only if
CONFIG_LMB_MEMORY_REGIONS is defined.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c24a2b1d6f5db4eb65393f6a77fae129b30b6233.1657183534.git.michal.simek@amd.com
include/lmb.h
lib/lmb.c

index ab277ca800046a28ff6737ecd85149e2f6af0c0f..1476d78c28238050cd164d6e949cf1a10a333757 100644 (file)
@@ -68,7 +68,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_MEMORY_REGIONS)
        struct lmb_property memory_regions[CONFIG_LMB_MEMORY_REGIONS];
        struct lmb_property reserved_regions[CONFIG_LMB_RESERVED_REGIONS];
 #endif
index f72996a4248e9c0f13deb12b9cc8f941ad2b58e3..f21fe672ae9694b6b9d2e533e4aa7c4c91033eb4 100644 (file)
--- 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;
-#else
+#elif IS_ENABLED(CONFIG_LMB_MEMORY_REGIONS)
        lmb->memory.max = CONFIG_LMB_MEMORY_REGIONS;
        lmb->reserved.max = CONFIG_LMB_RESERVED_REGIONS;
        lmb->memory.region = lmb->memory_regions;