cmd_flash.c: fix fix compile error for boards with DataFlash
PATCH 1/1 cmd_flash.c: fix fix compile error for boards with DataFlash
Commit 5669ed45 ("cmd_flash.c: fix warning: unused variable 'addr_first'/'addr_last'") changed the #ifdef logic areound the declaration of these variables and missed a combination of settings of HAS_DATAFLASH with SYS_NO_FLASH; this patch fixes this.
Also spotted by Alessandro Rubini <[email protected]>
Signed-off-by Wolfgang Denk <[email protected]>
--- common/cmd_flash.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
common/cmd_flash.c +3 -1
@@ -467,8 +467,10 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])flash_info_t *info;ulong bank;int i, n, sect_first, sect_last; -ulong addr_first, addr_last;#endif /* CONFIG_SYS_NO_FLASH */ +#if !defined(CONFIG_SYS_NO_FLASH ) || defined(CONFIG_HAS_DATAFLASH ) +ulong addr_first, addr_last; +#endif #if defined(CONFIG_CMD_JFFS2 ) && defined(CONFIG_CMD_MTDPARTS )struct mtd_device *dev;struct part_info *part;
Signature · 13 lines
1.6.0.6
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What about WRITING it first and rationalizing it afterwords? :-)
- Larry Wall in <[email protected]>