Skip to content

Commit

Permalink
mtd: mtdswap: fix compilation warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Mar 25, 2011
1 parent e21fa86 commit 68b1a1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/mtdswap.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static int mtdswap_wlfreq(unsigned int maxdiff)
static int mtdswap_choose_wl_tree(struct mtdswap_dev *d)
{
static unsigned int pick_cnt;
unsigned int i, idx, wear, max;
unsigned int i, idx = -1, wear, max;
struct rb_root *root;

max = 0;
Expand Down

0 comments on commit 68b1a1e

Please sign in to comment.