mtd/drivers/mtd/chips cfi_cmdset_0001.c, 1.137, 1.138 cfi_cmdset_0002.c, 1.98, 1.99 cfi_cmdset_0020.c, 1.10, 1.11

gleixner at infradead.org gleixner at infradead.org
Sat Jun 5 06:20:42 EDT 2004


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

Modified Files:
	cfi_cmdset_0001.c cfi_cmdset_0002.c cfi_cmdset_0020.c 
Log Message:
fix compiler warnings. Remove bogus ++ when writing remaining bytes

Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -r1.137 -r1.138
--- cfi_cmdset_0001.c	5 Jun 2004 01:04:01 -0000	1.137
+++ cfi_cmdset_0001.c	5 Jun 2004 10:20:38 -0000	1.138
@@ -1023,18 +1023,19 @@
 	z = 0;
 	while(z < words * CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map_write8 (map, *((__u8*)buf)++, adr+z);
+			map_write8 (map, *((__u8*)buf), adr+z);
 		} else if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)buf)++, adr+z);
+			map_write16 (map, *((__u16*)buf), adr+z);
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)buf)++, adr+z);
+			map_write32 (map, *((__u32*)buf), adr+z);
 		} else if (cfi_buswidth_is_8()) {
-			map_write64 (map, *((__u64*)buf)++, adr+z);
+			map_write64 (map, *((__u64*)buf), adr+z);
 		} else {
 			ret = -EINVAL;
 			goto out;
 		}
 		z += CFIDEV_BUSWIDTH;
+		buf += CFIDEV_BUSWIDTH;
 	}
 	if (bytes) {
 		int i = 0, n = 0;
@@ -1045,11 +1046,11 @@
 		while (i < CFIDEV_BUSWIDTH)
 			tmp_buf[i++] = 0xff;
 		if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)tmp_p)++, adr+z);
+			map_write16 (map, *((__u16*)tmp_p), adr+z);
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)tmp_p)++, adr+z);
+			map_write32 (map, *((__u32*)tmp_p), adr+z);
 		} else if (cfi_buswidth_is_8()) {
-			map_write64 (map, *((__u64*)tmp_p)++, adr+z);
+			map_write64 (map, *((__u64*)tmp_p), adr+z);
 		} else {
 			ret = -EINVAL;
 			goto out;

Index: cfi_cmdset_0002.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0002.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -r1.98 -r1.99
--- cfi_cmdset_0002.c	14 Apr 2004 11:15:36 -0000	1.98
+++ cfi_cmdset_0002.c	5 Jun 2004 10:20:38 -0000	1.99
@@ -1052,17 +1052,17 @@
 	while(z < words * CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
 			datum = *((__u8*)buf);
-			map_write8 (map, *((__u8*)buf)++, adr+z);
+			map_write8 (map, *((__u8*)buf), adr+z);
 		} else if (cfi_buswidth_is_2()) {
 			datum = *((__u16*)buf);
-			map_write16 (map, *((__u16*)buf)++, adr+z);
+			map_write16 (map, *((__u16*)buf), adr+z);
 		} else if (cfi_buswidth_is_4()) {
 			datum = *((__u32*)buf);
-			map_write32 (map, *((__u32*)buf)++, adr+z);
+			map_write32 (map, *((__u32*)buf), adr+z);
 #ifdef CFI_WORD_64
 		} else if (cfi_buswidth_is_8()) {
 			datum = *((__u64*)buf);
-			map_write64 (map, *((__u64*)buf)++, adr+z);
+			map_write64 (map, *((__u64*)buf), adr+z);
 #endif
 		} else {
 			printk(KERN_WARNING "MTD %s(): Unsupported buswidth %d\n",
@@ -1071,6 +1071,7 @@
 			goto op_failed;
 		}
 		z += CFIDEV_BUSWIDTH;
+		buf += CFIDEV_BUSWIDTH;
 	}
 	if (bytes) {
 		int i = 0, n = 0;
@@ -1082,14 +1083,14 @@
 			tmp_buf[i++] = 0xff;
 		if (cfi_buswidth_is_2()) {
 			datum = *((__u16*)tmp_p);
-			map_write16 (map, *((__u16*)tmp_p)++, adr+z);
+			map_write16 (map, *((__u16*)tmp_p), adr+z);
 		} else if (cfi_buswidth_is_4()) {
 			datum = *((__u32*)tmp_p);
-			map_write32 (map, *((__u32*)tmp_p)++, adr+z);
+			map_write32 (map, *((__u32*)tmp_p), adr+z);
 #ifdef CFI_WORD_64
 		} else if (cfi_buswidth_is_8()) {
 			datum = *((__u64*)tmp_p);
-			map_write64 (map, *((__u64*)tmp_p)++, adr+z);
+			map_write64 (map, *((__u64*)tmp_p), adr+z);
 #endif
 		} else {
 			printk(KERN_WARNING "MTD %s(): Unsupported buswidth %d\n",

Index: cfi_cmdset_0020.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0020.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- cfi_cmdset_0020.c	16 Oct 2003 11:00:51 -0000	1.10
+++ cfi_cmdset_0020.c	5 Jun 2004 10:20:38 -0000	1.11
@@ -512,13 +512,13 @@
 	cfi_write(map, CMD(len/CFIDEV_BUSWIDTH-1), cmd_adr );
         
 	/* Write data */
-	for (z = 0; z < len; z += CFIDEV_BUSWIDTH) {
+	for (z = 0; z < len; z += CFIDEV_BUSWIDTH, buf += CFIDEV_BUSWIDTH) {
 		if (cfi_buswidth_is_1()) {
-			map_write8 (map, *((__u8*)buf)++, adr+z);
+			map_write8 (map, *((__u8*)buf), adr+z);
 		} else if (cfi_buswidth_is_2()) {
-			map_write16 (map, *((__u16*)buf)++, adr+z);
+			map_write16 (map, *((__u16*)buf), adr+z);
 		} else if (cfi_buswidth_is_4()) {
-			map_write32 (map, *((__u32*)buf)++, adr+z);
+			map_write32 (map, *((__u32*)buf), adr+z);
 		} else {
 			DISABLE_VPP(map);
 			return -EINVAL;





More information about the linux-mtd-cvs mailing list