[MTD] [NAND] nand_base.c: fix type of eccpos pointer

2007-10-13 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8b099a390defd294a3832fe73626c25072967316
Commit: 8b099a390defd294a3832fe73626c25072967316
Parent: 4b23aff083649eafa141ed69ad0ff59ba639edf8
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Mon May 28 19:17:54 2007 +0100
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Thu Jun 28 20:23:40 2007 +0100

    [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 <[EMAIL PROTECTED]>
Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 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 7e68203..25673ea 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,
uint8_t *p = buf;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->ecccode;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
chip->ecc.read_page_raw(mtd, chip, buf);
 
@@ -810,7 +810,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, 
struct nand_chip *chip,
uint8_t *p = buf;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->ecccode;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
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,
int eccsteps = chip->ecc.steps;
uint8_t *ecc_calc = chip->buffers->ecccalc;
const uint8_t *p = buf;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
/* Software ecc calculation */
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,
int eccsteps = chip->ecc.steps;
uint8_t *ecc_calc = chip->buffers->ecccalc;
const uint8_t *p = buf;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MTD] [NAND] nand_base.c: fix type of eccpos pointer

2007-08-02 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=515495a1da9abf339b922b7919c4950e85b87b42
Commit: 515495a1da9abf339b922b7919c4950e85b87b42
Parent: a4265f8d9241ba583e48380f1b9e60cfcb798449
Author: Ben Dooks <[EMAIL PROTECTED]>
AuthorDate: Mon May 28 19:17:54 2007 +0100
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Thu Aug 2 21:47:01 2007 +0100

    [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 <[EMAIL PROTECTED]>
Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 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 4b019c6..24ac677 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,
uint8_t *p = buf;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->ecccode;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
chip->ecc.read_page_raw(mtd, chip, buf);
 
@@ -814,7 +814,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, 
struct nand_chip *chip,
uint8_t *p = buf;
uint8_t *ecc_calc = chip->buffers->ecccalc;
uint8_t *ecc_code = chip->buffers->ecccode;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
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,
int eccsteps = chip->ecc.steps;
uint8_t *ecc_calc = chip->buffers->ecccalc;
const uint8_t *p = buf;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
/* Software ecc calculation */
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,
int eccsteps = chip->ecc.steps;
uint8_t *ecc_calc = chip->buffers->ecccalc;
const uint8_t *p = buf;
-   int *eccpos = chip->ecc.layout->eccpos;
+   uint32_t *eccpos = chip->ecc.layout->eccpos;
 
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
chip->ecc.hwctl(mtd, NAND_ECC_WRITE);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html