Add [PATCH] ext4: fix build warning
[ext4-patch-queue/an.git] / fix-build-warning
blob961ed8bc9af1603fa34532ab0de8bff152b5c9fd
1 ext4: fix build warning
3 From: Wu Fengguang <fengguang.wu@intel.com>
5 Replace `if' with `goto' to assure gcc that ix has been initialized.
7 Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
8 ---
9 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
10 index ea2ce3c..885645e 100644
11 --- a/fs/ext4/extents.c
12 +++ b/fs/ext4/extents.c
13 @@ -1160,15 +1160,13 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
14         while (--depth >= 0) {
15                 ix = path[depth].p_idx;
16                 if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
17 -                       break;
18 +                       goto got_index;
19         }
21 -       if (depth < 0) {
22 -               /* we've gone up to the root and
23 -                * found no index to the right */
24 -               return 0;
25 -       }
26 +       /* we've gone up to the root and found no index to the right */
27 +       return 0;
29 +got_index:
30         /* we've found index to the right, let's
31          * follow it and find the closest allocated
32          * block to the right */
33 @@ -1201,7 +1200,6 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
34         *phys = ext_pblock(ex);
35         put_bh(bh);
36         return 0;
38  }
40  /*