From 7e4178f90eec862affc97469118d5008bd1b5bda Mon Sep 17 00:00:00 2001 From: Vitaly Wool Date: Wed, 7 Jun 2006 09:34:37 +0400 Subject: [PATCH] NAND: fix remaining OOB length calculation In nand_read_page_syndrome/nand_write_page_syndrome the calculation of the remaining oob length which is not used by the prepad/ecc/postpad areas is wrong. Signed-off-by: Vitaly Wool Signed-off-by: Thomas Gleixner --- drivers/mtd/nand/nand_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/mtd/nand') diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 77406fcf53b..e74678e928c 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -883,7 +883,7 @@ static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip, } /* Calculate remaining oob bytes */ - i = oob - chip->oob_poi; + i = mtd->oobsize - (oob - chip->oob_poi); if (i) chip->read_buf(mtd, oob, i); @@ -1334,7 +1334,7 @@ static void nand_write_page_syndrome(struct mtd_info *mtd, } /* Calculate remaining oob bytes */ - i = oob - chip->oob_poi; + i = mtd->oobsize - (oob - chip->oob_poi); if (i) chip->write_buf(mtd, oob, i); } -- cgit v1.2.3