[sheepdog] [PATCH 02/10] dog/vdi: clear performance tips generated by cppcheck

Ruoyu liangry at ucweb.com
Tue Sep 2 11:14:05 CEST 2014


This patch gets rid of the below message while performing a code
analysis with cppcheck.

[dog/vdi.c:972] -> [dog/vdi.c:974]: (performance) Variable 'ret' is
reassigned a value before the old one has been used.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 dog/vdi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dog/vdi.c b/dog/vdi.c
index 49fc62b..53c75f6 100644
--- a/dog/vdi.c
+++ b/dog/vdi.c
@@ -969,7 +969,7 @@ static int vdi_object_map(int argc, char **argv)
 	uint64_t idx = vdi_cmd_data.index;
 	struct sd_inode *inode = xmalloc(sizeof(*inode));
 	uint32_t vid;
-	int ret = EXIT_SUCCESS;
+	int ret;
 
 	ret = read_vdi_obj(vdiname, vdi_cmd_data.snapshot_id,
 			   vdi_cmd_data.snapshot_tag, NULL, inode,
-- 
1.8.3.2





More information about the sheepdog mailing list