diff mbox series

[next] btrfs: remove redundant initialization of variable dirty

Message ID 20230818135525.1206140-1-colin.i.king@gmail.com (mailing list archive)
State New, archived
Headers show
Series [next] btrfs: remove redundant initialization of variable dirty | expand

Commit Message

Colin Ian King Aug. 18, 2023, 1:55 p.m. UTC
The variable dirty is initialized with a value that is never read, it
is being re-assigned later on. Remove the redundant initialization.
Cleans up clang scan build warning:

fs/btrfs/inode.c:5965:7: warning: Value stored to 'dirty' during its
initialization is never read [deadcode.DeadStores]

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

Comments

David Sterba Oct. 6, 2023, 4:38 p.m. UTC | #1
On Fri, Aug 18, 2023 at 02:55:25PM +0100, Colin Ian King wrote:
> The variable dirty is initialized with a value that is never read, it
> is being re-assigned later on. Remove the redundant initialization.
> Cleans up clang scan build warning:
> 
> fs/btrfs/inode.c:5965:7: warning: Value stored to 'dirty' during its
> initialization is never read [deadcode.DeadStores]
> 
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7d11dbd74956..6441c0053355 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -5962,7 +5962,7 @@  static int btrfs_dirty_inode(struct btrfs_inode *inode)
 static int btrfs_update_time(struct inode *inode, int flags)
 {
 	struct btrfs_root *root = BTRFS_I(inode)->root;
-	bool dirty = flags & ~S_VERSION;
+	bool dirty;
 
 	if (btrfs_root_readonly(root))
 		return -EROFS;