diff options
author | Ben Dooks <ben-linux@fluff.org> | 2007-05-28 14:17:54 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-08-02 16:47:01 -0400 |
commit | 515495a1da9abf339b922b7919c4950e85b87b42 (patch) | |
tree | 46c29ffbd43faaa4461edd6de669f868333e5e72 /drivers/mtd | |
parent | a4265f8d9241ba583e48380f1b9e60cfcb798449 (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')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 4b019c6304e..24ac6778b1a 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -772,7 +772,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
772 | uint8_t *p = buf; | 772 | uint8_t *p = buf; |
773 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 773 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
774 | uint8_t *ecc_code = chip->buffers->ecccode; | 774 | uint8_t *ecc_code = chip->buffers->ecccode; |
775 | int *eccpos = chip->ecc.layout->eccpos; | 775 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
776 | 776 | ||
777 | chip->ecc.read_page_raw(mtd, chip, buf); | 777 | chip->ecc.read_page_raw(mtd, chip, buf); |
778 | 778 | ||
@@ -814,7 +814,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
814 | uint8_t *p = buf; | 814 | uint8_t *p = buf; |
815 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 815 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
816 | uint8_t *ecc_code = chip->buffers->ecccode; | 816 | uint8_t *ecc_code = chip->buffers->ecccode; |
817 | int *eccpos = chip->ecc.layout->eccpos; | 817 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
818 | 818 | ||
819 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { | 819 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { |
820 | chip->ecc.hwctl(mtd, NAND_ECC_READ); | 820 | chip->ecc.hwctl(mtd, NAND_ECC_READ); |
@@ -1420,7 +1420,7 @@ static void nand_write_page_swecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
1420 | int eccsteps = chip->ecc.steps; | 1420 | int eccsteps = chip->ecc.steps; |
1421 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 1421 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
1422 | const uint8_t *p = buf; | 1422 | const uint8_t *p = buf; |
1423 | int *eccpos = chip->ecc.layout->eccpos; | 1423 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
1424 | 1424 | ||
1425 | /* Software ecc calculation */ | 1425 | /* Software ecc calculation */ |
1426 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) | 1426 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) |
@@ -1446,7 +1446,7 @@ static void nand_write_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, | |||
1446 | int eccsteps = chip->ecc.steps; | 1446 | int eccsteps = chip->ecc.steps; |
1447 | uint8_t *ecc_calc = chip->buffers->ecccalc; | 1447 | uint8_t *ecc_calc = chip->buffers->ecccalc; |
1448 | const uint8_t *p = buf; | 1448 | const uint8_t *p = buf; |
1449 | int *eccpos = chip->ecc.layout->eccpos; | 1449 | uint32_t *eccpos = chip->ecc.layout->eccpos; |
1450 | 1450 | ||
1451 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { | 1451 | for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) { |
1452 | chip->ecc.hwctl(mtd, NAND_ECC_WRITE); | 1452 | chip->ecc.hwctl(mtd, NAND_ECC_WRITE); |