2021-12-08 07:53:12

by xu xin

[permalink] [raw]
Subject: [PATCH linux-next] ext4: Remove redundant 'offset' assignment

From: luo penghao <[email protected]>

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 <[email protected]>
Signed-off-by: luo penghao <[email protected]>
---
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




2022-01-06 04:42:00

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH linux-next] ext4: Remove redundant 'offset' assignment

On Wed, 8 Dec 2021 07:53:07 +0000, [email protected] wrote:
> From: luo penghao <[email protected]>
>
> 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 <[email protected]>