aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nand
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2014-01-20 15:03:24 +0000
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>2014-02-06 22:17:51 +0000
commit32c4c18045599ddfed36f52b276166ce932b1bf7 (patch)
tree0588eb0d97558a49f9c5417e954bb237032499b7 /src/flash/nand
parentfacd0e7827926d0639260be40e9cc4c595794194 (diff)
downloadriscv-openocd-32c4c18045599ddfed36f52b276166ce932b1bf7.zip
riscv-openocd-32c4c18045599ddfed36f52b276166ce932b1bf7.tar.gz
riscv-openocd-32c4c18045599ddfed36f52b276166ce932b1bf7.tar.bz2
flash: declare fixed arrays const
Change-Id: Id06b8b53ec59a7b3182f60f51dde5b16563aaeef Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/1887 Tested-by: jenkins
Diffstat (limited to 'src/flash/nand')
-rw-r--r--src/flash/nand/lpc32xx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/flash/nand/lpc32xx.c b/src/flash/nand/lpc32xx.c
index 38c7e33..c310f90 100644
--- a/src/flash/nand/lpc32xx.c
+++ b/src/flash/nand/lpc32xx.c
@@ -52,10 +52,10 @@ extern int nand_correct_data(struct nand_device *nand, u_char *dat,
#define SPARE_OFFS 0x140
#define DATA_OFFS 0x200
-static int sp_ooblayout[] = {
+static const int sp_ooblayout[] = {
10, 11, 12, 13, 14, 15
};
-static int lp_ooblayout[] = {
+static const int lp_ooblayout[] = {
40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57,
@@ -1148,7 +1148,7 @@ static int lpc32xx_write_page_slc(struct nand_device *nand,
/* Copy to oob, at correct offsets */
static uint8_t ecc[24];
slc_ecc_copy_to_buffer(ecc, hw_ecc, ecc_count);
- int *layout = nand->page_size == 2048 ? lp_ooblayout : sp_ooblayout;
+ const int *layout = nand->page_size == 2048 ? lp_ooblayout : sp_ooblayout;
int i;
for (i = 0; i < ecc_count * 3; i++)
foob[layout[i]] = ecc[i];
@@ -1549,7 +1549,7 @@ static int lpc32xx_read_page_slc(struct nand_device *nand,
slc_ecc_copy_to_buffer(ecc, hw_ecc, ecc_count);
/* Copy ECC from flash using correct layout */
static uint8_t fecc[24];/* max size */
- int *layout = nand->page_size == 2048 ? lp_ooblayout : sp_ooblayout;
+ const int *layout = nand->page_size == 2048 ? lp_ooblayout : sp_ooblayout;
int i;
for (i = 0; i < ecc_count * 3; i++)
fecc[i] = foob[layout[i]];