mtd/drivers/mtd/nand nand_base.c,1.136,1.137

Artem Bityuckiy dedekind at infradead.org
Thu Mar 24 09:33:26 EST 2005


Update of /home/cvs/mtd/drivers/mtd/nand
In directory phoenix.infradead.org:/tmp/cvs-serv16648

Modified Files:
	nand_base.c 
Log Message:
Use arrays of needed size instead of constant-sized.


Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -r1.136 -r1.137
--- nand_base.c	14 Mar 2005 18:30:44 -0000	1.136
+++ nand_base.c	24 Mar 2005 14:33:22 -0000	1.137
@@ -855,7 +855,7 @@
 	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 @@
 	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 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;





More information about the linux-mtd-cvs mailing list