[MTD] NAND: OOB buffer offset fixups

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jul 11 06:59:01 EDT 2006


Commit:     8b0036eefd7a96f23244b969417684c8627f5ad6
Parent:     90a18fab4ae07b77bf053b75a4d1285cd94faa79
commit 8b0036eefd7a96f23244b969417684c8627f5ad6
Author:     Vitaly Wool <vwool at ru.mvista.com>
AuthorDate: Tue Jul 11 09:11:25 2006 +0200
Commit:     Thomas Gleixner <tglx at cruncher.tec.linutronix.de>
CommitDate: Tue Jul 11 09:11:25 2006 +0200

    [MTD] NAND: OOB buffer offset fixups
    
    In the case of data-pad-ecc-pad-data... layout the oob start position
    has to be sizeof(data) in nand_write_oob_syndrom().
    
    In nand_fill_oob() we need to copy to buf + buffer offset instead of
    buf + write offset.
    
    From: Vitaly Wool <vwool at ru.mvista.com>
    Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
---
 drivers/mtd/nand/nand_base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 62b8613..cffd663 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1203,7 +1203,7 @@ static int nand_write_oob_syndrome(struc
 		pos = steps * (eccsize + chunk);
 		steps = 0;
 	} else
-		pos = eccsize + chunk;
+		pos = eccsize;
 
 	chip->cmdfunc(mtd, NAND_CMD_SEQIN, pos, page);
 	for (i = 0; i < steps; i++) {
@@ -1566,7 +1566,7 @@ static uint8_t *nand_fill_oob(struct nan
 				bytes = min_t(size_t, len, free->length);
 				boffs = free->offset;
 			}
-			memcpy(chip->oob_poi + woffs, oob, bytes);
+			memcpy(chip->oob_poi + boffs, oob, bytes);
 			oob += bytes;
 		}
 		return oob;



More information about the linux-mtd-cvs mailing list