All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] btrfs: remove redundant initialization of variable dirty
@ 2023-08-18 13:55 Colin Ian King
  2023-10-06 16:38 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2023-08-18 13:55 UTC (permalink / raw)
  To: Chris Mason, Josef Bacik, David Sterba, linux-btrfs
  Cc: kernel-janitors, linux-kernel

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(-)

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;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] btrfs: remove redundant initialization of variable dirty
  2023-08-18 13:55 [PATCH][next] btrfs: remove redundant initialization of variable dirty Colin Ian King
@ 2023-10-06 16:38 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2023-10-06 16:38 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
	kernel-janitors, linux-kernel

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-06 16:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18 13:55 [PATCH][next] btrfs: remove redundant initialization of variable dirty Colin Ian King
2023-10-06 16:38 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.