All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - cleanup: simplify
Date: Mon, 15 Mar 2021 10:14:06 +0000 (GMT)	[thread overview]
Message-ID: <20210315101406.E896C3858D29@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b563c926ba348be14988889a581c81ca09ca66e0
Commit:        b563c926ba348be14988889a581c81ca09ca66e0
Parent:        664d3b0f226ffbbf064157885d7d4f8c0aed49cf
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Fri Mar 12 13:25:42 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sun Mar 14 16:34:38 2021 +0100

cleanup: simplify

---
 tools/lvconvert.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 4c159b01e..b50074294 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4958,7 +4958,7 @@ static int _lvconvert_split_cache_single(struct cmd_context *cmd,
 	struct logical_volume *lv_main = NULL;
 	struct logical_volume *lv_fast = NULL;
 	struct lv_segment *seg;
-	int ret;
+	int ret = 0;
 
 	if (lv_is_writecache(lv)) {
 		lv_main = lv;
@@ -5031,10 +5031,8 @@ static int _lvconvert_split_cache_single(struct cmd_context *cmd,
 			log_print_unless_silent("Logical volume %s is not cached and %s is unused.",
 						display_lvname(lv), display_lvname(lv_fast));
 
-		} else  {
+		} else
 			log_error(INTERNAL_ERROR "Unknown cache split command.");
-			ret = 0;
-		}
 
 	} else if (lv_is_cache(lv_main) && lv_is_cache_pool(lv_fast)) {
 		if (cmd->command->command_enum == lvconvert_split_and_remove_cache_CMD)
@@ -5043,14 +5041,10 @@ static int _lvconvert_split_cache_single(struct cmd_context *cmd,
 		else if (cmd->command->command_enum == lvconvert_split_and_keep_cache_CMD)
 			ret = _lvconvert_split_and_keep_cachepool(cmd, lv_main, lv_fast);
 
-		else  {
+		else
 			log_error(INTERNAL_ERROR "Unknown cache split command.");
-			ret = 0;
-		}
-	} else {
+	} else
 		log_error(INTERNAL_ERROR "Unknown cache split command.");
-		ret = 0;
-	}
 
 	if (!ret)
 		return ECMD_FAILED;



             reply	other threads:[~2021-03-15 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 10:14 Zdenek Kabelac [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-04-06 11:47 main - cleanup: simplify Zdenek Kabelac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210315101406.E896C3858D29@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.