summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorVitaly Wool <vwool@ru.mvista.com>2006-06-07 07:34:37 +0200
committerDavid Woodhouse <dwmw2@infradead.org>2006-06-20 21:31:23 +0200
commit7e4178f90eec862affc97469118d5008bd1b5bda (patch)
treeb8b88499e53f5f306754aa26e879e3915e4e7e2c /drivers/mtd
parent[MTD] NAND Fixup NDFC merge brokeness (diff)
downloadlinux-7e4178f90eec862affc97469118d5008bd1b5bda.tar.xz
linux-7e4178f90eec862affc97469118d5008bd1b5bda.zip
[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 <vwool@ru.mvista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/nand_base.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 77406fcf53b3..e74678e928cf 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);
}