Skip to contentSkip to conversation

mtd: nand: fix the partial page write condition

PATCH New Tao Hou 1 participant 1 message Mar 10, 2013

Subsystems (2)
lore
Share & tools
lore

Tao Hou

author
#0 lore raw

PATCH 1/1 mtd: nand: fix the partial page write condition

When writelen is mtd->writesize - 1, it is still a partial page write

---
 drivers/mtd/nand/nand_base.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_base.c +1 -1
index 4321415..c6161eb 100644
@@ -2210,7 +2210,7 @@ static int nand_do_write_ops(struct mtd_info *mtd, loff_t to,
 		uint8_t *wbuf = buf;
 
 		/* Partial page write? */
-		if (unlikely(column || writelen < (mtd->writesize - 1))) {
+		if (unlikely(column || writelen < mtd->writesize)) {
 			cached = 0;
 			bytes = min_t(int, bytes - column, (int) writelen);
 			chip->pagebuf = -1;
Signature · 1 line
1.7.9.5