Skip to content

Commit

Permalink
sheep/gateway Remove warning ‘nr_vids’ may be used uninitialized in t…
Browse files Browse the repository at this point in the history
…his function

gateway.c:696: warning: ‘nr_vids’ may be used uninitialized in this function

Signed-off-by: Hongzhou Zhang <hongzhou.h.zhang@intel.com>
Signed-off-by: Hitoshi Mitake <mitake.hitoshi@lab.ntt.co.jp>
(cherry picked from commit e36699b)
  • Loading branch information
zhanghongzhou authored and tmenjo committed Jul 15, 2016
1 parent a9820ea commit c716f01
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sheep/gateway.c
Expand Up @@ -691,7 +691,7 @@ int gateway_write_obj(struct request *req)
uint32_t *vids = NULL, *new_vids = req->data;
struct generation_reference *refs = NULL, *zeroed_refs = NULL;
struct update_obj_refcnt_work *refcnt_work;
size_t nr_vids;
size_t nr_vids = hdr->data_length / sizeof(*vids);

if ((req->rq.flags & SD_FLAG_CMD_TGT) &&
is_refresh_required(oid_to_vid(oid))) {
Expand All @@ -707,8 +707,6 @@ int gateway_write_obj(struct request *req)


if (is_data_vid_update(hdr)) {
nr_vids = hdr->data_length / sizeof(*vids);

invalidate_other_nodes(oid_to_vid(oid));

/* read the previous vids to discard their references later */
Expand Down

0 comments on commit c716f01

Please sign in to comment.