[PATCH] fs/ntfs3: remove redundant assignment to variable frame

Colin Ian King posted 1 patch 4 years, 6 months ago
fs/ntfs3/file.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] fs/ntfs3: remove redundant assignment to variable frame
Posted by Colin Ian King 4 years, 6 months ago
Variable frame is assigned a value that is never read. The
assignment is redundant and can be removed. Cleans up the
clang-scan build warning:

fs/ntfs3/file.c:995:3: warning: Value stored to 'frame' is
never read [deadcode.DeadStores]
                frame = pos >> frame_bits;

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 fs/ntfs3/file.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index 3bae76930e68..27c32692513c 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -992,7 +992,6 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
 		if (bytes > count)
 			bytes = count;
 
-		frame = pos >> frame_bits;
 		frame_vbo = pos & ~(frame_size - 1);
 		index = frame_vbo >> PAGE_SHIFT;
 
-- 
2.33.1

Re: [PATCH] fs/ntfs3: remove redundant assignment to variable frame
Posted by Konstantin Komarov 4 years ago

On 12/30/21 18:59, Colin Ian King wrote:
> Variable frame is assigned a value that is never read. The
> assignment is redundant and can be removed. Cleans up the
> clang-scan build warning:
> 
> fs/ntfs3/file.c:995:3: warning: Value stored to 'frame' is
> never read [deadcode.DeadStores]
>                  frame = pos >> frame_bits;
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> ---
>   fs/ntfs3/file.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index 3bae76930e68..27c32692513c 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -992,7 +992,6 @@ static ssize_t ntfs_compress_write(struct kiocb *iocb, struct iov_iter *from)
>   		if (bytes > count)
>   			bytes = count;
>   
> -		frame = pos >> frame_bits;
>   		frame_vbo = pos & ~(frame_size - 1);
>   		index = frame_vbo >> PAGE_SHIFT;
>   

Applied, thanks!