CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined
Since commit86cf1c8285("configs: Migrate CONFIG_NR_DRAM_BANKS") & commit999a772d9f("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>
This commit is contained in:
@@ -1073,8 +1073,6 @@ int fdtdec_setup_mem_size_base(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NR_DRAM_BANKS)
|
||||
|
||||
ofnode get_next_memory_node(ofnode mem)
|
||||
{
|
||||
do {
|
||||
@@ -1170,7 +1168,6 @@ int fdtdec_setup_mem_size_base_lowest(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
|
||||
# if CONFIG_IS_ENABLED(MULTI_DTB_FIT_GZIP) ||\
|
||||
@@ -1633,7 +1630,6 @@ int fdtdec_resetup(int *rescan)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NR_DRAM_BANKS
|
||||
int fdtdec_decode_ram_size(const void *blob, const char *area, int board_id,
|
||||
phys_addr_t *basep, phys_size_t *sizep,
|
||||
struct bd_info *bd)
|
||||
@@ -1739,6 +1735,5 @@ int fdtdec_decode_ram_size(const void *blob, const char *area, int board_id,
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_NR_DRAM_BANKS */
|
||||
|
||||
#endif /* !USE_HOSTCC */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user