[sheepdog] [PATCH 01/10] dog/farm: clear performance tips generated by cppcheck
Ruoyu
liangry at ucweb.com
Tue Sep 2 11:14:04 CEST 2014
This patch gets rid of the below message while performing a code analysis
with cppcheck.
[dog/farm/farm.c:207] -> [dog/farm/farm.c:218]: (performance) Variable
'ret' is reassigned a value before the old one has been used.
Signed-off-by: Ruoyu <liangry at ucweb.com>
---
dog/farm/farm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dog/farm/farm.c b/dog/farm/farm.c
index 5d07be9..83c297f 100644
--- a/dog/farm/farm.c
+++ b/dog/farm/farm.c
@@ -204,7 +204,7 @@ out:
static int notify_vdi_add(uint32_t vdi_id, uint8_t nr_copies,
uint8_t copy_policy)
{
- int ret = -1;
+ int ret;
struct sd_req hdr;
struct sd_rsp *rsp = (struct sd_rsp *)&hdr;
char *buf = NULL;
--
1.8.3.2
More information about the sheepdog
mailing list