[sheepdog] [PATCH 06/10] sheep/oc: clear performance tips generated by cppcheck

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


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

[sheep/object_cache.c:805] -> [sheep/object_cache.c:815]: (performance)
Variable 'ret' is reassigned a value before the old one has been used.

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

diff --git a/sheep/object_cache.c b/sheep/object_cache.c
index edfac6d..967ee43 100644
--- a/sheep/object_cache.c
+++ b/sheep/object_cache.c
@@ -802,7 +802,7 @@ out:
 static int object_cache_pull(struct object_cache *oc, uint64_t idx)
 {
 	struct sd_req hdr;
-	int ret = SD_RES_NO_MEM;
+	int ret;
 	uint64_t oid = idx_to_oid(oc->vid, idx);
 	uint32_t data_length = get_objsize(oid);
 	void *buf;
-- 
1.8.3.2





More information about the sheepdog mailing list