* [PATCH][next] btrfs: send: remove redundant assignments to variable ret
@ 2024-11-13 13:00 Colin Ian King
2024-11-26 15:44 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-11-13 13:00 UTC (permalink / raw)
To: Chris Mason, Josef Bacik, David Sterba, linux-btrfs
Cc: kernel-janitors, linux-kernel
The variable ret is being initialized to zero and also later
re-assigned to zero. In both cases the assignment is redundant
since the value is never read after the assignment and hence
they can be removed.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
fs/btrfs/send.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 7254279c3cc9..c5a318feb8ae 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -7253,7 +7253,7 @@ static int changed_cb(struct btrfs_path *left_path,
enum btrfs_compare_tree_result result,
struct send_ctx *sctx)
{
- int ret = 0;
+ int ret;
/*
* We can not hold the commit root semaphore here. This is because in
@@ -7313,7 +7313,6 @@ static int changed_cb(struct btrfs_path *left_path,
return 0;
}
result = BTRFS_COMPARE_TREE_CHANGED;
- ret = 0;
}
sctx->left_path = left_path;
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] btrfs: send: remove redundant assignments to variable ret
2024-11-13 13:00 [PATCH][next] btrfs: send: remove redundant assignments to variable ret Colin Ian King
@ 2024-11-26 15:44 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2024-11-26 15:44 UTC (permalink / raw)
To: Colin Ian King
Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
kernel-janitors, linux-kernel
On Wed, Nov 13, 2024 at 01:00:12PM +0000, Colin Ian King wrote:
> The variable ret is being initialized to zero and also later
> re-assigned to zero. In both cases the assignment is redundant
> since the value is never read after the assignment and hence
> they can be removed.
>
> Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Added to for-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-26 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-13 13:00 [PATCH][next] btrfs: send: remove redundant assignments to variable ret Colin Ian King
2024-11-26 15:44 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®