diff options
author | Artem B. Bityuckiy <dedekind@infradead.org> | 2005-03-24 09:33:26 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@mtd.linutronix.de> | 2005-05-23 07:04:06 -0400 |
commit | 15fc108606a499df44549274a95d1e3455823347 (patch) | |
tree | 9a24edb20f71653b8cf80c1714492c730af231d1 /drivers/mtd/nand/nand_base.c | |
parent | 8f5a4486c05275a5f3d53c80c86a44adb7fb8823 (diff) |
[MTD] NAND: Use arrays of needed size instead of constant-sized.
Signed-off-by: Artem B. Bityuckiy <dedekind@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | 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 index cc3cd277064b..422c465f311d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -59,7 +59,7 @@ | |||
59 | * The AG-AND chips have nice features for speed improvement, | 59 | * The AG-AND chips have nice features for speed improvement, |
60 | * which are not supported yet. Read / program 4 pages in one go. | 60 | * which are not supported yet. Read / program 4 pages in one go. |
61 | * | 61 | * |
62 | * $Id: nand_base.c,v 1.136 2005/03/14 18:30:44 bjd Exp $ | 62 | * $Id: nand_base.c,v 1.137 2005/03/24 14:33:22 dedekind Exp $ |
63 | * | 63 | * |
64 | * This program is free software; you can redistribute it and/or modify | 64 | * This program is free software; you can redistribute it and/or modify |
65 | * it under the terms of the GNU General Public License version 2 as | 65 | * it under the terms of the GNU General Public License version 2 as |
@@ -855,7 +855,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa | |||
855 | u_char *oob_buf, struct nand_oobinfo *oobsel, int cached) | 855 | u_char *oob_buf, struct nand_oobinfo *oobsel, int cached) |
856 | { | 856 | { |
857 | int i, status; | 857 | int i, status; |
858 | u_char ecc_code[32]; | 858 | u_char ecc_code[oobsel->eccbytes]; |
859 | int eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE; | 859 | int eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE; |
860 | int *oob_config = oobsel->eccpos; | 860 | int *oob_config = oobsel->eccpos; |
861 | int datidx = 0, eccidx = 0, eccsteps = this->eccsteps; | 861 | int datidx = 0, eccidx = 0, eccsteps = this->eccsteps; |
@@ -961,7 +961,7 @@ static int nand_verify_pages (struct mtd_info *mtd, struct nand_chip *this, int | |||
961 | int i, j, datidx = 0, oobofs = 0, res = -EIO; | 961 | int i, j, datidx = 0, oobofs = 0, res = -EIO; |
962 | int eccsteps = this->eccsteps; | 962 | int eccsteps = this->eccsteps; |
963 | int hweccbytes; | 963 | int hweccbytes; |
964 | u_char oobdata[64]; | 964 | u_char oobdata[mtd->oobsize]; |
965 | 965 | ||
966 | hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes / eccsteps) : 0; | 966 | hweccbytes = (this->options & NAND_HWECC_SYNDROME) ? (oobsel->eccbytes / eccsteps) : 0; |
967 | 967 | ||
@@ -1107,8 +1107,8 @@ int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len, | |||
1107 | int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; | 1107 | int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0; |
1108 | struct nand_chip *this = mtd->priv; | 1108 | struct nand_chip *this = mtd->priv; |
1109 | u_char *data_poi, *oob_data = oob_buf; | 1109 | u_char *data_poi, *oob_data = oob_buf; |
1110 | u_char ecc_calc[32]; | 1110 | u_char ecc_calc[oobsel->eccbytes]; |
1111 | u_char ecc_code[32]; | 1111 | u_char ecc_code[oobsel->eccbytes]; |
1112 | int eccmode, eccsteps; | 1112 | int eccmode, eccsteps; |
1113 | int *oob_config, datidx; | 1113 | int *oob_config, datidx; |
1114 | int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1; | 1114 | int blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1; |