diff options
| author | Viresh Kumar <viresh.kumar@linaro.org> | 2012-10-29 22:47:26 +0530 |
|---|---|---|
| committer | Ben Hutchings <ben@decadent.org.uk> | 2017-11-11 13:34:46 +0000 |
| commit | e09bdbeef9cef82cf5bb11d9b576731db4abdc4c (patch) | |
| tree | 9271239e81f48451c6a09cc283c0daff8282df52 /include/linux | |
| parent | 5d74ba4ca379c23959c60fbbf18e27dd02ac17f1 (diff) | |
mtd: map: Fix compilation warning
commit 3e9ce49e0ef95e22790a74720f0068696b2477c9 upstream.
This patch is an attempt to fix following compilation warning.
In file included from drivers/mtd/chips/cfi_cmdset_0001.c:35:0:
drivers/mtd/chips/cfi_cmdset_0001.c: In function 'cfi_intelext_write_words':
include/linux/mtd/map.h:331:11: warning: 'r.x[0]' may be used uninitialized in this function [-Wmaybe-uninitialized]
I could have used uninitialized_var() too, but didn't used it as the final else
part of map_word_load() is missing. So there is a chance that it might be passed
uninitialized. Better initialize to zero.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/mtd/map.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 3887901bf48c..ec69d760c49d 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -327,7 +327,7 @@ static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word static inline map_word map_word_load(struct map_info *map, const void *ptr) { - map_word r; + map_word r = {{0} }; if (map_bankwidth_is_1(map)) r.x[0] = *(unsigned char *)ptr; |
