All of lore.kernel.org
 help / color / mirror / Atom feed
* main - cleanup: simplify
@ 2021-03-15 10:14 Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2021-03-15 10:14 UTC (permalink / raw)
  To: lvm-devel

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;



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

* main - cleanup: simplify
@ 2023-04-06 11:47 Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2023-04-06 11:47 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1fb3e08033570365580b576777e312d2f9c2d86d
Commit:        1fb3e08033570365580b576777e312d2f9c2d86d
Parent:        a7cf55c6a19a0a70dab7f2b8a406d52e24d5e3cd
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Wed Mar 1 21:05:47 2023 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Thu Apr 6 11:06:04 2023 +0200

cleanup: simplify

---
 lib/metadata/integrity_manip.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/metadata/integrity_manip.c b/lib/metadata/integrity_manip.c
index ffb869b08..456795532 100644
--- a/lib/metadata/integrity_manip.c
+++ b/lib/metadata/integrity_manip.c
@@ -936,7 +936,9 @@ int lv_integrity_mismatches(struct cmd_context *cmd,
 			    const struct logical_volume *lv,
 			    uint64_t *mismatches)
 {
-	struct lv_with_info_and_seg_status status;
+	struct lv_with_info_and_seg_status status = {
+		.seg_status.type = SEG_STATUS_NONE,
+	};
 
 	if (lv_is_raid(lv) && lv_raid_has_integrity((struct logical_volume *)lv))
 		return lv_raid_integrity_total_mismatches(cmd, lv, mismatches);
@@ -944,9 +946,6 @@ int lv_integrity_mismatches(struct cmd_context *cmd,
 	if (!lv_is_integrity(lv))
 		return_0;
 
-	memset(&status, 0, sizeof(status));
-	status.seg_status.type = SEG_STATUS_NONE;
-
 	status.seg_status.seg = first_seg(lv);
 
 	/* FIXME: why reporter_pool? */


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

end of thread, other threads:[~2023-04-06 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-15 10:14 main - cleanup: simplify Zdenek Kabelac
  -- strict thread matches above, loose matches on Subject: below --
2023-04-06 11:47 Zdenek Kabelac

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.