mtd/drivers/mtd/nand diskonchip.c,1.23,1.24

Kalev Lember kalev at infradead.org
Thu Jul 15 13:19:45 EDT 2004


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

Modified Files:
	diskonchip.c 
Log Message:
fix compiler warnings


Index: diskonchip.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/diskonchip.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- diskonchip.c	13 Jul 2004 00:14:35 -0000	1.23
+++ diskonchip.c	15 Jul 2004 17:19:43 -0000	1.24
@@ -654,7 +654,7 @@
 	int offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
 	int ret, retlen;
 
-	end = min(end, mtd->size); // paranoia
+	end = min(end, (int)mtd->size); // paranoia
 	for (offs = 0; offs < end; offs += mtd->erasesize) {
 		ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf);
 		if (retlen != mtd->oobblock) continue;
@@ -714,7 +714,7 @@
 //#endif
 
 	blocks = mtd->size >> this->phys_erase_shift;
-	maxblocks = min(32768, mtd->erasesize - psize);
+	maxblocks = min(32768, (int)mtd->erasesize - psize);
 
 	if (mh->UnitSizeFactor == 0x00) {
 		/* Auto-determine UnitSizeFactor.  The constraints are:
@@ -741,7 +741,7 @@
 		mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
 		printk(KERN_INFO "Setting virtual erase size to %d\n", mtd->erasesize);
 		blocks = mtd->size >> this->bbt_erase_shift;
-		maxblocks = min(32768, mtd->erasesize - psize);
+		maxblocks = min(32768, (int)mtd->erasesize - psize);
 	}
 
 	if (blocks > maxblocks) {
@@ -1096,14 +1096,16 @@
 	}
 
 	for (mtd = doclist; mtd; mtd = doc->nextdoc) {
+		unsigned char oldval;
+		unsigned char newval;
 		nand = mtd->priv;
 		doc = (void *)nand->priv;
 		/* Use the alias resolution register to determine if this is
 		   in fact the same DOC aliased to a new address.  If writes
 		   to one chip's alias resolution register change the value on
 		   the other chip, they're the same chip. */
-		unsigned char oldval = ReadDOC(doc->virtadr, AliasResolution);
-		unsigned char newval = ReadDOC(virtadr, AliasResolution);
+		oldval = ReadDOC(doc->virtadr, AliasResolution);
+		newval = ReadDOC(virtadr, AliasResolution);
 		if (oldval != newval)
 			continue;
 		WriteDOC(~newval, virtadr, AliasResolution);





More information about the linux-mtd-cvs mailing list