Skip to contentSkip to conversation

f2fs: file: drop useless initializer in expand_inode_data()

PATCH Applied Sergey Shtylyov 3 participants 3 messages Dec 20, 2022 – Jan 9, 2023 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: file: drop useless initializer in expand_inode_data()

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.

---
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(-)
fs/f2fs/file.c +1 -1
Index: 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;

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Sergey Shtylyov

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.

Thanks,

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

#2 lore raw
In reply to Sergey Shtylyov
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 8 lines · 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!

Signature · 10 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel