From: Stefan Roese Date: Thu, 13 Aug 2020 13:28:29 +0200 Subject: [PATCH v4 1/9] CONFIG_NR_DRAM_BANKS: Remove unreferenced code as its always defined In-Reply-To: <20200813111411.GN1891694@smile.fi.intel.com> References: <20200813054800.469284-1-sr@denx.de> <20200813054800.469284-2-sr@denx.de> <20200813111411.GN1891694@smile.fi.intel.com> Message-ID: <40db5eaf-1147-8a3e-e754-fa0ac0b195bd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 13.08.20 13:14, Andy Shevchenko wrote: > On Thu, Aug 13, 2020 at 07:47:52AM +0200, 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. > > ... > >> int pci_addr_cells, addr_cells, size_cells; >> + struct bd_info *bd = gd->bd; >> int cells_per_record; >> const u32 *prop; >> int len; > >> /* Add a region for our local memory */ > >> -#ifdef CONFIG_NR_DRAM_BANKS >> - struct bd_info *bd = gd->bd; >> - > > Can we leave assignment here? Sure. Just curious why? Is it recommended not to make the assignment with the declaration? Thanks, Stefan