diff options
author | Stefan Roese | 2020-08-12 11:55:46 +0200 |
---|---|---|
committer | Stefan Roese | 2020-08-26 09:19:16 +0200 |
commit | dfaf6a57974f5b4bcdc2a2a347b192573ffb5135 (patch) | |
tree | 6edcb0d2fa5ed61611427d881c07f04e9bbab8dc /lib/lmb.c | |
parent | 9f9ecd3e4d7839e24c182fb7b24937e19b670f1b (diff) |
CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined
Since commit 86cf1c82850f ("configs: Migrate CONFIG_NR_DRAM_BANKS") &
commit 999a772d9f24 ("Kconfig: Migrate CONFIG_NR_DRAM_BANKS"),
CONFIG_NR_DRAM_BANKS is always defined with a value (4 is default).
It makes no sense to still carry code that is guarded with
"#ifndef CONFIG_NR_DRAM_BANKS" (and similar). This patch removes
all these unreferenced code paths.
Signed-off-by: Stefan Roese <sr@denx.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'lib/lmb.c')
-rw-r--r-- | lib/lmb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/lmb.c b/lib/lmb.c index 75082f35599..d126f8dc04a 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -117,22 +117,17 @@ static void lmb_reserve_common(struct lmb *lmb, void *fdt_blob) /* Initialize the struct, add memory and call arch/board reserve functions */ void lmb_init_and_reserve(struct lmb *lmb, struct bd_info *bd, void *fdt_blob) { -#ifdef CONFIG_NR_DRAM_BANKS int i; -#endif lmb_init(lmb); -#ifdef CONFIG_NR_DRAM_BANKS + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { if (bd->bi_dram[i].size) { lmb_add(lmb, bd->bi_dram[i].start, bd->bi_dram[i].size); } } -#else - if (bd->bi_memsize) - lmb_add(lmb, bd->bi_memstart, bd->bi_memsize); -#endif + lmb_reserve_common(lmb, fdt_blob); } |