From: Michal Simek Date: Mon, 27 Jul 2020 08:55:31 +0200 Subject: [PATCH] CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined In-Reply-To: <20200724145436.1544898-1-sr@denx.de> References: <20200724145436.1544898-1-sr@denx.de> Message-ID: <5a979404-f1e1-dddb-e42f-8ff67f4cc74e@xilinx.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 24. 07. 20 16:54, Stefan Roese wrote: > 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 > Cc: Tom Rini > Cc: Ramon Fried > Cc: Simon Glass > Cc: Michal Simek > --- > arch/x86/cpu/broadwell/cpu_from_spl.c | 2 -- > board/xilinx/zynqmp/zynqmp.c | 2 -- > cmd/bdinfo.c | 2 -- > common/board_f.c | 6 +----- > common/image.c | 3 +-- > common/init/handoff.c | 4 ---- > drivers/pci/pci-uclass.c | 17 +---------------- > include/asm-generic/u-boot.h | 2 -- > include/handoff.h | 2 -- > lib/fdtdec.c | 5 ----- > lib/lmb.c | 7 ------- > 11 files changed, 3 insertions(+), 49 deletions(-) > > diff --git a/arch/x86/cpu/broadwell/cpu_from_spl.c b/arch/x86/cpu/broadwell/cpu_from_spl.c > index 6567d50653..4d4cdafa2b 100644 > --- a/arch/x86/cpu/broadwell/cpu_from_spl.c > +++ b/arch/x86/cpu/broadwell/cpu_from_spl.c > @@ -53,14 +53,12 @@ void board_debug_uart_init(void) > > int dram_init_banksize(void) > { > -#ifdef CONFIG_NR_DRAM_BANKS > struct spl_handoff *ho; > > ho = bloblist_find(BLOBLISTT_SPL_HANDOFF, sizeof(*ho)); > if (!ho) > return log_msg_ret("Missing SPL hand-off info", -ENOENT); > handoff_load_dram_banks(ho); > -#endif > > return 0; > } > diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c > index ebb7172908..4cc5cb6fd7 100644 > --- a/board/xilinx/zynqmp/zynqmp.c > +++ b/board/xilinx/zynqmp/zynqmp.c > @@ -467,10 +467,8 @@ int dram_init(void) > #else > int dram_init_banksize(void) > { > -#if defined(CONFIG_NR_DRAM_BANKS) > gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE; > gd->bd->bi_dram[0].size = get_effective_memsize(); > -#endif > > mem_map_fill(); > Acked-by: Michal Simek (for zynqmp) Thanks, Michal