* [U-Boot] [PATCH] mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations
@ 2009-07-14 21:00 Kim Phillips
2009-07-16 13:28 ` Stefan Roese
0 siblings, 1 reply; 2+ messages in thread
From: Kim Phillips @ 2009-07-14 21:00 UTC (permalink / raw)
To: u-boot
a.k.a cfi_mtd.c does as cfi_flash.c does. This also prevents
the TQM834x build from doing a:
cfi_mtd.c:36: error: variably modified 'cfi_mtd_info' at file scope
cfi_mtd.c:37: error: variably modified 'cfi_mtd_names' at file scope
using gcc 4.4.
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
drivers/mtd/cfi_mtd.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index c7e357b..34748dd 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -31,10 +31,17 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/concat.h>
+/* use CONFIG_SYS_MAX_FLASH_BANKS_DETECT if defined */
+#ifdef CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+# define CFI_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS_DETECT
+#else
+# define CFI_MAX_FLASH_BANKS CONFIG_SYS_MAX_FLASH_BANKS
+#endif
+
extern flash_info_t flash_info[];
-static struct mtd_info cfi_mtd_info[CONFIG_SYS_MAX_FLASH_BANKS];
-static char cfi_mtd_names[CONFIG_SYS_MAX_FLASH_BANKS][16];
+static struct mtd_info cfi_mtd_info[CFI_MAX_FLASH_BANKS];
+static char cfi_mtd_names[CFI_MAX_FLASH_BANKS][16];
#ifdef CONFIG_MTD_CONCAT
static char c_mtd_name[16];
#endif
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations
2009-07-14 21:00 [U-Boot] [PATCH] mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations Kim Phillips
@ 2009-07-16 13:28 ` Stefan Roese
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Roese @ 2009-07-16 13:28 UTC (permalink / raw)
To: u-boot
On Tuesday 14 July 2009 23:00:24 Kim Phillips wrote:
> a.k.a cfi_mtd.c does as cfi_flash.c does. This also prevents
> the TQM834x build from doing a:
>
> cfi_mtd.c:36: error: variably modified 'cfi_mtd_info' at file scope
> cfi_mtd.c:37: error: variably modified 'cfi_mtd_names' at file scope
>
> using gcc 4.4.
>
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Applied to cfi-flash. Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-16 13:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-14 21:00 [U-Boot] [PATCH] mtd: cfi - if defined, use MAX_FLASH_BANKS_DETECT for static declarations Kim Phillips
2009-07-16 13:28 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox