mtd/include/linux/mtd map.h,1.48,1.49

gleixner at infradead.org gleixner at infradead.org
Tue May 24 14:45:18 EDT 2005


Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv25374

Modified Files:
	map.h 
Log Message:
Make map_word_ff ware of the flash buswidth

map_word_ff() was setting the mapword to ~0UL regardless of the
buswidth of the mapped flash chip. The read_map functions are
buswidth aware and therefor the map_word_equal function failed.



Index: map.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/map.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- map.h	16 Feb 2005 15:54:59 -0000	1.48
+++ map.h	24 May 2005 18:45:15 -0000	1.49
@@ -340,13 +340,22 @@
 	return orig;
 }
 
+#if BITS_PER_LONG < 64
+#define MAP_FF_LIMIT 4
+#else
+#define MAP_FF_LIMIT 8
+#endif
+
 static inline map_word map_word_ff(struct map_info *map)
 {
 	map_word r;
 	int i;
-
-	for (i=0; i<map_words(map); i++) {
-		r.x[i] = ~0UL;
+	
+	if (map_bank_width(map) < MAP_FF_LIMIT) {
+		r.x[0] = (1 << (8*map_bank_width(map))) - 1;
+	} else {
+		for (i=0; i<map_words(map); i++)
+			r.x[i] = ~0UL;
 	}
 	return r;
 }





More information about the linux-mtd-cvs mailing list