* [U-Boot] [PATCH] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST usage
@ 2011-04-13 16:46 Peter Tyser
2011-04-13 19:50 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Peter Tyser @ 2011-04-13 16:46 UTC (permalink / raw)
To: u-boot
Commit 6ee1416e8184b4d9ebe6087d396a60bcecf3551c (mtd, cfi: introduce
void flash_protect_default(void)) introduced a bug which resulted in
boards that define CONFIG_SYS_FLASH_AUTOPROTECT_LIST not compiling with
the the following errors and warning:
ptyser at petert u-boot $ make -s xpedite520x
Configuring for xpedite520x board...
cfi_flash.c: In function 'flash_protect_default':
cfi_flash.c:2118: error: 'i' undeclared (first use in this function)
cfi_flash.c:2118: error: (Each undeclared identifier is reported only once
cfi_flash.c:2118: error: for each function it appears in.)
cfi_flash.c:2118: error: 'apl' undeclared (first use in this function)
cfi_flash.c:2118: error: invalid application of 'sizeof' to incomplete type 'struct apl_s'
cfi_flash.c: In function 'flash_init':
cfi_flash.c:2137: warning: unused variable 'apl'
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Reported-by: Kumar Gala <galak@kernel.crashing.org>
Cc: Heiko Schocher <hs@denx.de>
---
Thanks for noticing this Kumar.
drivers/mtd/cfi_flash.c | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 5788328..91ddcb4 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2089,6 +2089,14 @@ static void cfi_flash_set_config_reg(u32 base, u16 val)
void flash_protect_default(void)
{
+#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
+ int i;
+ struct apl_s {
+ ulong start;
+ ulong size;
+ } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
+#endif
+
/* Monitor protection ON by default */
#if (CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE) && \
(!defined(CONFIG_MONITOR_IS_IN_RAM))
@@ -2130,12 +2138,6 @@ unsigned long flash_init (void)
{
unsigned long size = 0;
int i;
-#if defined(CONFIG_SYS_FLASH_AUTOPROTECT_LIST)
- struct apl_s {
- ulong start;
- ulong size;
- } apl[] = CONFIG_SYS_FLASH_AUTOPROTECT_LIST;
-#endif
#ifdef CONFIG_SYS_FLASH_PROTECTION
/* read environment from EEPROM */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST usage
2011-04-13 16:46 [U-Boot] [PATCH] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST usage Peter Tyser
@ 2011-04-13 19:50 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2011-04-13 19:50 UTC (permalink / raw)
To: u-boot
Dear Peter Tyser,
In message <1302713216-23363-1-git-send-email-ptyser@xes-inc.com> you wrote:
> Commit 6ee1416e8184b4d9ebe6087d396a60bcecf3551c (mtd, cfi: introduce
> void flash_protect_default(void)) introduced a bug which resulted in
> boards that define CONFIG_SYS_FLASH_AUTOPROTECT_LIST not compiling with
> the the following errors and warning:
> ptyser at petert u-boot $ make -s xpedite520x
> Configuring for xpedite520x board...
> cfi_flash.c: In function 'flash_protect_default':
> cfi_flash.c:2118: error: 'i' undeclared (first use in this function)
> cfi_flash.c:2118: error: (Each undeclared identifier is reported only once
> cfi_flash.c:2118: error: for each function it appears in.)
> cfi_flash.c:2118: error: 'apl' undeclared (first use in this function)
> cfi_flash.c:2118: error: invalid application of 'sizeof' to incomplete type 'struct apl_s'
> cfi_flash.c: In function 'flash_init':
> cfi_flash.c:2137: warning: unused variable 'apl'
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> Reported-by: Kumar Gala <galak@kernel.crashing.org>
> Cc: Heiko Schocher <hs@denx.de>
> ---
> Thanks for noticing this Kumar.
>
> drivers/mtd/cfi_flash.c | 14 ++++++++------
> 1 files changed, 8 insertions(+), 6 deletions(-)
Appled, thanks.
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
The shortest unit of time in the multiverse is the News York Second,
defined as the period of time between the traffic lights turning
green and the cab behind you honking.
- Terry Pratchett, _Lords and Ladies_
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-13 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13 16:46 [U-Boot] [PATCH] cfi_flash: Fix CONFIG_SYS_FLASH_AUTOPROTECT_LIST usage Peter Tyser
2011-04-13 19:50 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox