From: Wolfgang Denk Date: Sun, 19 Jul 2009 19:36:53 +0200 Subject: [U-Boot] [PATCH] cmd_flash.c: fix compile error for boards with DataFlash In-Reply-To: <20090719163317.GA18649@mail.gnudd.com> References: <20090719163317.GA18649@mail.gnudd.com> Message-ID: <20090719173653.701CB832E416@gemini.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 Dear Alessandro Rubini, In message <20090719163317.GA18649@mail.gnudd.com> you wrote: > From: Alessandro Rubini > > The local variables addr_first and addr_last are used if HAS_DATAFLASH > even if SYS_NO_FLASH (meaning no NOR flash). This adds the definitions > withing the brace where the names are used, to avoid cluttering the > initial ifdef. > > Signed-off-by: Alessandro Rubini Yes, I ran into this myself, too. Unfortunaltely I must have overlooked these ARM error messages when I tested commit 5669ed45 ("cmd_flash.c: fix warning: unused variable 'addr_first'/'addr_last'"). Instead of adding another declaration for these variables as you are doing here, I prefer to change the #ifdef mess^H^H^H^Hlogic earlier in the file: