All of lore.kernel.org
 help / color / mirror / Atom feed
* dev-next - cleanup: reduce code dupliction
@ 2021-03-22 15:39 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2021-03-22 15:39 UTC (permalink / raw)
  To: lvm-devel

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d3d28b1b64ff6b89ac5150787f694e1db1794a1f
Commit:        d3d28b1b64ff6b89ac5150787f694e1db1794a1f
Parent:        d37b19aaaab0c28f4d1e4ae0690c73c0031a027b
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Fri Mar 19 10:45:26 2021 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Fri Mar 19 23:21:18 2021 +0100

cleanup: reduce code dupliction

---
 lib/raid/raid.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 941ba8dc8..2f1eb6cf8 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -441,12 +441,10 @@ static int _raid_target_percent(void **target_state,
 
 	*total_numerator += sr->insync_regions;
 	*total_denominator += sr->total_regions;
+	*percent = dm_make_percent(sr->insync_regions, sr->total_regions);
 
 	if (seg)
-		seg->extents_copied = (uint64_t) seg->area_len
-			* dm_make_percent(sr->insync_regions , sr->total_regions) / DM_PERCENT_100;
-
-	*percent = dm_make_percent(sr->insync_regions, sr->total_regions);
+		seg->extents_copied = (uint64_t) seg->area_len * *percent / DM_PERCENT_100;
 
 	dm_pool_free(mem, sr);
 



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-22 15:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22 15:39 dev-next - cleanup: reduce code dupliction David Teigland

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.