1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cleanup: use struct initializers instead of memset

No need to call memset if we the language can do that.
This commit is contained in:
Zdenek Kabelac 2012-03-30 17:17:25 +02:00
parent 865b9d3701
commit ba222c6e35

View File

@ -86,9 +86,7 @@ static int _request_confirmation(struct cmd_context *cmd,
const struct logical_volume *lv,
const struct lvresize_params *lp)
{
struct lvinfo info;
memset(&info, 0, sizeof(info));
struct lvinfo info = { 0 };
if (!lv_info(cmd, lv, 0, &info, 1, 0) && driver_version(NULL, 0)) {
log_error("lv_info failed: aborting");
@ -738,8 +736,6 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
return ECMD_FAILED;
}
memset(&info, 0, sizeof(info));
if (lv_info(cmd, lv, 0, &info, 0, 0) && info.exists) {
log_error("Snapshot origin volumes can be resized "
"only while inactive: try lvchange -an");
@ -873,12 +869,10 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
int lvresize(struct cmd_context *cmd, int argc, char **argv)
{
struct lvresize_params lp;
struct lvresize_params lp = { 0 };
struct volume_group *vg;
int r;
memset(&lp, 0, sizeof(lp));
if (!_lvresize_params(cmd, argc, argv, &lp))
return EINVALID_CMD_LINE;