tree 9a24edb20f71653b8cf80c1714492c730af231d1
parent 8f5a4486c05275a5f3d53c80c86a44adb7fb8823
author Artem B. Bityuckiy <[EMAIL PROTECTED]> Thu, 24 Mar 2005 14:33:26 +0000
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 13:04:06 +0200

[MTD] NAND: Use arrays of needed size instead of constant-sized.

Signed-off-by: Artem B. Bityuckiy <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/nand/nand_base.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -59,7 +59,7 @@
  *     The AG-AND chips have nice features for speed improvement,
  *     which are not supported yet. Read / program 4 pages in one go.
  *
- * $Id: nand_base.c,v 1.136 2005/03/14 18:30:44 bjd Exp $
+ * $Id: nand_base.c,v 1.137 2005/03/24 14:33:22 dedekind Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -855,7 +855,7 @@ static int nand_write_page (struct mtd_i
        u_char *oob_buf,  struct nand_oobinfo *oobsel, int cached)
 {
        int     i, status;
-       u_char  ecc_code[32];
+       u_char  ecc_code[oobsel->eccbytes];
        int     eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE;
        int     *oob_config = oobsel->eccpos;
        int     datidx = 0, eccidx = 0, eccsteps = this->eccsteps;
@@ -961,7 +961,7 @@ static int nand_verify_pages (struct mtd
        int     i, j, datidx = 0, oobofs = 0, res = -EIO;
        int     eccsteps = this->eccsteps;
        int     hweccbytes; 
-       u_char  oobdata[64];
+       u_char  oobdata[mtd->oobsize];
 
        hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes 
/ eccsteps) : 0;
 
@@ -1107,8 +1107,8 @@ int nand_do_read_ecc (struct mtd_info *m
        int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0;
        struct nand_chip *this = mtd->priv;
        u_char *data_poi, *oob_data = oob_buf;
-       u_char ecc_calc[32];
-       u_char ecc_code[32];
+       u_char ecc_calc[oobsel->eccbytes];
+       u_char ecc_code[oobsel->eccbytes];
         int eccmode, eccsteps;
        int     *oob_config, datidx;
        int     blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) 
- 1;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to