* [PATCH linux-next] ext4: Remove redundant 'offset' assignment
@ 2021-12-08 7:53 cgel.zte
2022-01-06 4:41 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2021-12-08 7:53 UTC (permalink / raw)
To: Theodore Ts'o
Cc: Andreas Dilger, linux-ext4, linux-kernel, luo penghao, Zeal Robot
From: luo penghao <luo.penghao@zte.com.cn>
Although it is in the loop, offset is reassigned at the beginning of the
while loop. And know that the function ends, 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>
---
fs/ext4/dir.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 74b172a..a6bb86f 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -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;
--
2.15.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-next] ext4: Remove redundant 'offset' assignment
2021-12-08 7:53 [PATCH linux-next] ext4: Remove redundant 'offset' assignment cgel.zte
@ 2022-01-06 4:41 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2022-01-06 4:41 UTC (permalink / raw)
To: cgel.zte
Cc: Theodore Ts'o, Andreas Dilger, linux-kernel, linux-ext4,
luo penghao, Zeal Robot
On Wed, 8 Dec 2021 07:53:07 +0000, cgel.zte@gmail.com wrote:
> From: luo penghao <luo.penghao@zte.com.cn>
>
> Although it is in the loop, offset is reassigned at the beginning of the
> while loop. And know that the function ends, the value will not be used
>
> The clang_analyzer complains as follows:
>
> [...]
Applied, thanks!
[1/1] ext4: Remove redundant 'offset' assignment
commit: e81dca082197eed04b89a7c511b454a3c8dd55fb
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-06 4:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-08 7:53 [PATCH linux-next] ext4: Remove redundant 'offset' assignment cgel.zte
2022-01-06 4:41 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).