From: Zdenek Kabelac Date: Sat, 20 Feb 2021 21:44:06 +0000 (+0100) Subject: cleanup: simplify initilization X-Git-Tag: v2_03_12~368 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=5237175cb6486c782589d7c9afb4f532ee5897b1;p=lvm2.git cleanup: simplify initilization Simplier code and also drop duplicate check for active LV. --- diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 4dee97ee0..a67b4ee72 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -6126,7 +6126,7 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd, struct volume_group *vg = lv->vg; struct logical_volume *lv_wcorig; struct logical_volume *lv_fast; - struct writecache_settings settings; + struct writecache_settings settings = { 0 }; const char *fast_name; uint32_t block_size_sectors = 0; char *lockd_fast_args = NULL; @@ -6181,10 +6181,6 @@ int lvconvert_writecache_attach_single(struct cmd_context *cmd, is_active = lv_is_active(lv); - is_active = lv_is_active(lv); - - memset(&settings, 0, sizeof(settings)); - if (!get_writecache_settings(cmd, &settings, &block_size_sectors)) { log_error("Invalid writecache settings."); goto bad;