[PATCH] mtd: fix compile warning with newer GCC in flash maps
Jamie Iles
jamie at jamieiles.com
Tue Aug 23 05:27:50 EDT 2011
For invalid map bankwidths, BUG() out for map_word_load() and
inline_map_write() like inline_map_read() does. This fixes the warning
below and for other maps.
drivers/mtd/chips/cfi_cmdset_0002.c: In function 'cfi_amdstd_write_words':
include/linux/mtd/map.h:330:11: warning: 'r$x$0' may be used uninitialized in this function
Cc: Artem Bityutskiy <dedekind1 at gmail.com>
Cc: David Woodhouse <dwmw2 at infradead.org>
Signed-off-by: Jamie Iles <jamie at jamieiles.com>
---
include/linux/mtd/map.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index a9e6ba4..cbc5a3d 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -341,6 +341,8 @@ static inline map_word map_word_load(struct map_info *map, const void *ptr)
#endif
else if (map_bankwidth_is_large(map))
memcpy(r.x, ptr, map->bankwidth);
+ else
+ BUG();
return r;
}
@@ -424,6 +426,9 @@ static inline void inline_map_write(struct map_info *map, const map_word datum,
#endif
else if (map_bankwidth_is_large(map))
memcpy_toio(map->virt+ofs, datum.x, map->bankwidth);
+ else
+ BUG();
+
mb();
}
--
1.7.4.1
More information about the linux-mtd
mailing list