Skip to contentSkip to conversation

LVM: cleanup 1

PATCH New Jonathan Brassow 2 participants 2 messages Jan 10, 2011 – Jan 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 LVM: cleanup 1

Patch name: lvm-cleanup-1.patch

lvcreate() does a 'memset(&lp, 0, sizeof(lp))', which is done by very next function called. No need to do it twice.

tools/lvcreate.c +0 -2
Index: LVM2/tools/lvcreate.c
===================================================================
@@ -538,8 +538,6 @@ int lvcreate(struct cmd_context *cmd, in
 	struct lvcreate_cmdline_params lcp;
 	struct volume_group *vg;
 
-	memset(&lp, 0, sizeof(lp));
-
 	if (!_lvcreate_params(&lp, &lcp, cmd, argc, argv))
 		return EINVALID_CMD_LINE;
 
#1 lore raw

PATCH 1/1 LVM: cleanup 1

Dne 10.1.2011 21:56, Jonathan Brassow napsal(a):

Quoted 10 lines

Patch name: lvm-cleanup-1.patch

lvcreate() does a 'memset(&lp, 0, sizeof(lp))', which is done by very next function called. No need to do it twice.

Index: LVM2/tools/lvcreate.c
===================================================================

tools/lvcreate.c int lvcreate(struct cmd_context *cmd, in · line 542

Quoted 7 lines
tools/lvcreate.c +0 -2
@@ -538,8 +538,6 @@ int lvcreate(struct cmd_context *cmd, in
 	struct lvcreate_cmdline_params lcp;
 	struct volume_group *vg;
 
-	memset(&lp, 0, sizeof(lp));
-
 	if (!_lvcreate_params(&lp, &lcp, cmd, argc, argv))
 		return EINVALID_CMD_LINE;

Ack

Valid and we already do the same with lcp.

Zdenek