aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2007-05-28 14:17:54 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-06-28 15:23:40 -0400
commit8b099a390defd294a3832fe73626c25072967316 (patch)
tree95c61a560bdda26e154ac75a7e4ddb997d05df48 /drivers/mtd/nand
parent4b23aff083649eafa141ed69ad0ff59ba639edf8 (diff)
[MTD] [NAND] nand_base.c: fix type of eccpos pointer
The nand_base.c driver implicitly casts the uint32_t eccpos array to 'int *', which is not only not guaranteed to be the same sign as the source, but is not guaranteed to be the same size. Fix by changing nand_base.c to use uint32_t referencing the eccpos fields. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/nand_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 7e68203fe1ba..25673eacdd88 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -768,7 +768,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
768 uint8_t *p = buf; 768 uint8_t *p = buf;
769 uint8_t *ecc_calc = chip->buffers->ecccalc; 769 uint8_t *ecc_calc = chip->buffers->ecccalc;
770 uint8_t *ecc_code = chip->buffers->ecccode; 770 uint8_t *ecc_code = chip->buffers->ecccode;
771 int *eccpos = chip->ecc.layout->eccpos; 771 uint32_t *eccpos = chip->ecc.layout->eccpos;
772 772
773 chip->ecc.read_page_raw(mtd, chip, buf); 773 chip->ecc.read_page_raw(mtd, chip, buf);
774 774
@@ -810,7 +810,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
810 uint8_t *p = buf; 810 uint8_t *p = buf;
811 uint8_t *ecc_calc = chip->buffers->ecccalc; 811 uint8_t *ecc_calc = chip->buffers->ecccalc;
812 uint8_t *ecc_code = chip->buffers->ecccode; 812 uint8_t *ecc_code = chip->buffers->ecccode;
813 int *eccpos = chip->ecc.layout->eccpos; 813 uint32_t *eccpos = chip->ecc.layout->eccpos;
814 814
815 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { 815 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
816 chip->ecc.hwctl(mtd, NAND_ECC_READ); 816 chip->ecc.hwctl(mtd, NAND_ECC_READ);
@@ -1416,7 +1416,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
1416 int eccsteps = chip->ecc.steps; 1416 int eccsteps = chip->ecc.steps;
1417 uint8_t *ecc_calc = chip->buffers->ecccalc; 1417 uint8_t *ecc_calc = chip->buffers->ecccalc;
1418 const uint8_t *p = buf; 1418 const uint8_t *p = buf;
1419 int *eccpos = chip->ecc.layout->eccpos; 1419 uint32_t *eccpos = chip->ecc.layout->eccpos;
1420 1420
1421 /* Software ecc calculation */ 1421 /* Software ecc calculation */
1422 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) 1422 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
@@ -1442,7 +1442,7 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
1442 int eccsteps = chip->ecc.steps; 1442 int eccsteps = chip->ecc.steps;
1443 uint8_t *ecc_calc = chip->buffers->ecccalc; 1443 uint8_t *ecc_calc = chip->buffers->ecccalc;
1444 const uint8_t *p = buf; 1444 const uint8_t *p = buf;
1445 int *eccpos = chip->ecc.layout->eccpos; 1445 uint32_t *eccpos = chip->ecc.layout->eccpos;
1446 1446
1447 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { 1447 for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
1448 chip->ecc.hwctl(mtd, NAND_ECC_WRITE); 1448 chip->ecc.hwctl(mtd, NAND_ECC_WRITE);