diff mbox series

[linux-next] ext4: Remove redundant o_start statements

Message ID 20211208075157.404535-1-luo.penghao@zte.com.cn
State Awaiting Upstream
Headers show
Series [linux-next] ext4: Remove redundant o_start statements | expand

Commit Message

CGEL Dec. 8, 2021, 7:51 a.m. UTC
From: luo penghao <luo.penghao@zte.com.cn>

The if will goto out of the loop, and until the end of the
function execution, o_start will not be used again.

The clang_analyzer complains as follows:

fs/ext4/move_extent.c:635:5 warning:

Value stored to 'o_start' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
---
 fs/ext4/move_extent.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Theodore Ts'o Jan. 6, 2022, 4:41 a.m. UTC | #1
On Wed, 8 Dec 2021 07:51:57 +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
> 
> The if will goto out of the loop, and until the end of the
> function execution, o_start will not be used again.
> 
> The clang_analyzer complains as follows:
> 
> [...]

Applied, thanks!

[1/1] ext4: Remove redundant o_start statements
      commit: b687e7ba0849122bf862639b98256a0b984a940a

Best regards,
diff mbox series

Patch

diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 64a5797..95aa212 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -632,7 +632,6 @@  ext4_move_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
 		/* Check hole before the start pos */
 		if (cur_blk + cur_len - 1 < o_start) {
 			if (next_blk == EXT_MAX_BLOCKS) {
-				o_start = o_end;
 				ret = -ENODATA;
 				goto out;
 			}