From ddaf2002c94a33863ef7adf69ad4cdffcfbd73c5 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 14 Oct 2019 11:53:59 +0200 Subject: [PATCH] lvconvert: use struct initializer Always good to keep rest of structure initilized with zeros. --- tools/lvconvert.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index caef5d5a5..8ecbf3418 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -5290,7 +5290,11 @@ static int _lvconvert_detach_writecache(struct cmd_context *cmd, static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv) { - struct wipe_params wp; + struct wipe_params wp = { + .do_wipe_signatures = 1, /* optional, to print warning if clobbering something */ + .do_zero = 1, /* required for dm-writecache to work */ + .zero_sectors = 1 + }; int ret; if (!activate_lv(cmd, lv)) { @@ -5298,11 +5302,6 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv) return 0; } - wp.do_wipe_signatures = 1; /* optional, to print warning if clobbering something */ - wp.do_zero = 1; /* required for dm-writecache to work */ - wp.zero_sectors = 1; - wp.zero_value = 0; - ret = wipe_lv(lv, wp); if (!deactivate_lv(cmd, lv)) { -- 2.43.5