diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-25 11:10:16 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-03-25 11:10:16 -0400 |
commit | 68b1a1e786f29c900fa1c516a402e24f0ece622a (patch) | |
tree | ea9bed01be0ee11ff3e6e119aa1883bad85b35f7 /drivers/mtd/mtdswap.c | |
parent | e21fa86ad0ffa2c292b104ea19bdaa46ceab7105 (diff) |
mtd: mtdswap: fix compilation warning
Fix the following compilation warning:
drivers/mtd/mtdswap.c: In function ‘mtdswap_pick_gc_eblk’:
drivers/mtd/mtdswap.c:859: warning: ‘idx’ may be used uninitialized in this function
drivers/mtd/mtdswap.c:859: note: ‘idx’ was declared here
Initialize idx to -1 because this value means "no tree choosen".
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/mtdswap.c')
-rw-r--r-- | drivers/mtd/mtdswap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c index dc4b136800b8..237913c5c92c 100644 --- a/drivers/mtd/mtdswap.c +++ b/drivers/mtd/mtdswap.c | |||
@@ -850,7 +850,7 @@ static int mtdswap_wlfreq(unsigned int maxdiff) | |||
850 | static int mtdswap_choose_wl_tree(struct mtdswap_dev *d) | 850 | static int mtdswap_choose_wl_tree(struct mtdswap_dev *d) |
851 | { | 851 | { |
852 | static unsigned int pick_cnt; | 852 | static unsigned int pick_cnt; |
853 | unsigned int i, idx, wear, max; | 853 | unsigned int i, idx = -1, wear, max; |
854 | struct rb_root *root; | 854 | struct rb_root *root; |
855 | 855 | ||
856 | max = 0; | 856 | max = 0; |