From b983e96ae2005de2239e0b1032caa0c2e4bff34a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 25 Nov 2008 17:34:34 -0500 Subject: [PATCH] Add [PATCH] ext4: fix build warning --- fix-build-warning | 40 ++++++++++++++++++++++++++++++++++++++++ series | 1 + 2 files changed, 41 insertions(+) create mode 100644 fix-build-warning diff --git a/fix-build-warning b/fix-build-warning new file mode 100644 index 00000000..961ed8bc --- /dev/null +++ b/fix-build-warning @@ -0,0 +1,40 @@ +ext4: fix build warning + +From: Wu Fengguang + +Replace `if' with `goto' to assure gcc that ix has been initialized. + +Signed-off-by: Wu Fengguang +--- +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index ea2ce3c..885645e 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -1160,15 +1160,13 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path, + while (--depth >= 0) { + ix = path[depth].p_idx; + if (ix != EXT_LAST_INDEX(path[depth].p_hdr)) +- break; ++ goto got_index; + } + +- if (depth < 0) { +- /* we've gone up to the root and +- * found no index to the right */ +- return 0; +- } ++ /* we've gone up to the root and found no index to the right */ ++ return 0; + ++got_index: + /* we've found index to the right, let's + * follow it and find the closest allocated + * block to the right */ +@@ -1201,7 +1200,6 @@ ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path, + *phys = ext_pblock(ex); + put_bh(bh); + return 0; +- + } + + /* diff --git a/series b/series index efcffcb9..b0450c8c 100644 --- a/series +++ b/series @@ -12,6 +12,7 @@ wrap-credential-accesses tone-down-ext4_da_writepages-errors fix-delalloc-writepages-to-allocate-at-correct-offset avoid-ext4-error-for-single-bg-fs +fix-build-warning ########################################## # unstable patches -- 2.11.4.GIT