mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] btrfs: return a literal instead of a variable
@ 2025-03-05 15:01 Dan Carpenter
  2025-03-06  0:44 ` Anand Jain
  2025-03-06  8:29 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-03-05 15:01 UTC (permalink / raw)
  To: Chris Mason
  Cc: Josef Bacik, David Sterba, linux-btrfs, linux-kernel, kernel-janitors

This is just a small clean up, it doesn't change how the code works.
Originally this code had a goto so we needed to set "ret = 0;" but now
it returns directly and so we can simplify it a bit by doing a
"return 0;" and removing the assignment.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 fs/btrfs/dev-replace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c
index 1a82e88ec5c1..53d7d85cb4be 100644
--- a/fs/btrfs/dev-replace.c
+++ b/fs/btrfs/dev-replace.c
@@ -103,7 +103,6 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
 			"found replace target device without a valid replace item");
 			return -EUCLEAN;
 		}
-		ret = 0;
 		dev_replace->replace_state =
 			BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED;
 		dev_replace->cont_reading_from_srcdev_mode =
@@ -120,7 +119,7 @@ int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info)
 		dev_replace->tgtdev = NULL;
 		dev_replace->is_valid = 0;
 		dev_replace->item_needs_writeback = 0;
-		return ret;
+		return 0;
 	}
 	slot = path->slots[0];
 	eb = path->nodes[0];
-- 
2.47.2


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

* Re: [PATCH] btrfs: return a literal instead of a variable
  2025-03-05 15:01 [PATCH] btrfs: return a literal instead of a variable Dan Carpenter
@ 2025-03-06  0:44 ` Anand Jain
  2025-03-06  8:29 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Anand Jain @ 2025-03-06  0:44 UTC (permalink / raw)
  To: Dan Carpenter, Chris Mason
  Cc: Josef Bacik, David Sterba, linux-btrfs, linux-kernel, kernel-janitors


looks good.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thx

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

* Re: [PATCH] btrfs: return a literal instead of a variable
  2025-03-05 15:01 [PATCH] btrfs: return a literal instead of a variable Dan Carpenter
  2025-03-06  0:44 ` Anand Jain
@ 2025-03-06  8:29 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2025-03-06  8:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chris Mason, Josef Bacik, David Sterba, linux-btrfs,
	linux-kernel, kernel-janitors

On Wed, Mar 05, 2025 at 06:01:57PM +0300, Dan Carpenter wrote:
> This is just a small clean up, it doesn't change how the code works.
> Originally this code had a goto so we needed to set "ret = 0;" but now
> it returns directly and so we can simplify it a bit by doing a
> "return 0;" and removing the assignment.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Added to for-next, thanks.

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

end of thread, other threads:[~2025-03-06  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-05 15:01 [PATCH] btrfs: return a literal instead of a variable Dan Carpenter
2025-03-06  0:44 ` Anand Jain
2025-03-06  8:29 ` 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®