Skip to content

Commit

Permalink
ext4: remove unnecessary 'offset' assignment
Browse files Browse the repository at this point in the history
Although it is in the loop, offset is reassigned at the beginning of the
while loop.  And after the loop, the value will not be used

The clang_analyzer complains as follows:

fs/ext4/dir.c:306:3 warning:

Value stored to 'offset' is never read

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: luo penghao <luo.penghao@zte.com.cn>
Link: https://lore.kernel.org/r/20211208075307.404703-1-luo.penghao@zte.com.cn
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
luo penghao authored and Theodore Ts'o committed Jan 10, 2022
1 parent a6dbc76 commit ae6ec19
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/ext4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ static int ext4_readdir(struct file *file, struct dir_context *ctx)
goto done;
brelse(bh);
bh = NULL;
offset = 0;
}
done:
err = 0;
Expand Down

0 comments on commit ae6ec19

Please sign in to comment.