[MTD] [OneNAND] Use pre-alloced oob buffer instead of local buffer
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 14 Dec 2007 05:47:21 +0000 (14:47 +0900)
committerKyungmin Park <kyungmin.park@samsung.com>
Tue, 29 Jan 2008 08:14:01 +0000 (17:14 +0900)
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/mtd/onenand/onenand_base.c

index ad052c8233c2cd0ffd0e791be25ef22b0913740c..b281b116aaeb55dab9c8c4e210cba43231392a17 100644 (file)
@@ -1217,7 +1217,7 @@ int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
 static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to)
 {
        struct onenand_chip *this = mtd->priv;
-       u_char oobbuf[64];
+       u_char *oob_buf = this->oob_buf;
        int status, i;
 
        this->command(mtd, ONENAND_CMD_READOOB, to, mtd->oobsize);
@@ -1226,9 +1226,9 @@ static int onenand_verify_oob(struct mtd_info *mtd, const u_char *buf, loff_t to
        if (status)
                return status;
 
-       this->read_bufferram(mtd, ONENAND_SPARERAM, oobbuf, 0, mtd->oobsize);
+       this->read_bufferram(mtd, ONENAND_SPARERAM, oob_buf, 0, mtd->oobsize);
        for (i = 0; i < mtd->oobsize; i++)
-               if (buf[i] != 0xFF && buf[i] != oobbuf[i])
+               if (buf[i] != 0xFF && buf[i] != oob_buf[i])
                        return -EBADMSG;
 
        return 0;
@@ -2307,7 +2307,8 @@ static int onenand_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
 static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
                        size_t len)
 {
-       unsigned char oob_buf[64];
+       struct onenand_chip *this = mtd->priv;
+       u_char *oob_buf = this->oob_buf;
        size_t retlen;
        int ret;