aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/mtd/map.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 115b14a634da..dd36d9433f00 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
1 1
2/* Overhauled routines for dealing with different mmap regions of flash */ 2/* Overhauled routines for dealing with different mmap regions of flash */
3/* $Id: map.h,v 1.48 2005/02/16 15:54:59 nico Exp $ */ 3/* $Id: map.h,v 1.49 2005/05/24 18:45:15 gleixner Exp $ */
4 4
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
@@ -340,13 +340,22 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig
340 return orig; 340 return orig;
341} 341}
342 342
343#if BITS_PER_LONG < 64
344#define MAP_FF_LIMIT 4
345#else
346#define MAP_FF_LIMIT 8
347#endif
348
343static inline map_word map_word_ff(struct map_info *map) 349static inline map_word map_word_ff(struct map_info *map)
344{ 350{
345 map_word r; 351 map_word r;
346 int i; 352 int i;
347 353
348 for (i=0; i<map_words(map); i++) { 354 if (map_bank_width(map) < MAP_FF_LIMIT) {
349 r.x[i] = ~0UL; 355 r.x[0] = (1 << (8*map_bank_width(map))) - 1;
356 } else {
357 for (i=0; i<map_words(map); i++)
358 r.x[i] = ~0UL;
350 } 359 }
351 return r; 360 return r;
352} 361}