diff mbox series

[f2fs-dev,REPOST] f2fs: file: drop useless initializer in expand_inode_data()

Message ID 38010b42-afd3-5394-09df-2378b7b5d10f@omp.ru (mailing list archive)
State Accepted
Commit 39bee2e6acc2522d88feb324b18178b34cb7b75a
Headers show
Series [f2fs-dev,REPOST] f2fs: file: drop useless initializer in expand_inode_data() | expand

Commit Message

Sergey Shtylyov Dec. 20, 2022, 5:17 p.m. UTC
In expand_inode_data(), the 'new_size' local variable is initialized to
the result of i_size_read(), however this value isn't ever used,  so we
can drop this initializer...

Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
This patch is against the 'dev' branch of Jaegeuk Kim's F2FS repo...
Reposting with ISP RAS mailing lists CC'ed now...

 fs/f2fs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chao Yu Dec. 21, 2022, 12:22 p.m. UTC | #1
On 2022/12/21 1:17, Sergey Shtylyov wrote:
> In expand_inode_data(), the 'new_size' local variable is initialized to
> the result of i_size_read(), however this value isn't ever used,  so we
> can drop this initializer...
> 
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
patchwork-bot+f2fs@kernel.org Jan. 9, 2023, 10:51 p.m. UTC | #2
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Tue, 20 Dec 2022 20:17:32 +0300 you wrote:
> In expand_inode_data(), the 'new_size' local variable is initialized to
> the result of i_size_read(), however this value isn't ever used,  so we
> can drop this initializer...
> 
> Found by Linux Verification Center (linuxtesting.org) with the SVACE static
> analysis tool.
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,REPOST] f2fs: file: drop useless initializer in expand_inode_data()
    https://git.kernel.org/jaegeuk/f2fs/c/39bee2e6acc2

You are awesome, thank you!
diff mbox series

Patch

Index: f2fs/fs/f2fs/file.c
===================================================================
--- f2fs.orig/fs/f2fs/file.c
+++ f2fs/fs/f2fs/file.c
@@ -1697,7 +1697,7 @@  static int expand_inode_data(struct inod
 			.err_gc_skipped = true,
 			.nr_free_secs = 0 };
 	pgoff_t pg_start, pg_end;
-	loff_t new_size = i_size_read(inode);
+	loff_t new_size;
 	loff_t off_end;
 	block_t expanded = 0;
 	int err;