From: Changcheng Liu Date: Thu, 20 Aug 2020 02:07:16 +0000 (+0800) Subject: crush: avoid redundant value assignement X-Git-Tag: v16.1.0~1291^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=58dbf9572576f42e33a932153ecc9d68b4c9ee1c;p=ceph.git crush: avoid redundant value assignement memset(bucket, 0, sizeof(*bucket)) has set all bucket field to be zero Signed-off-by: Changcheng Liu --- diff --git a/src/crush/builder.c b/src/crush/builder.c index 68dfcb69bc17..27b1319ce5eb 100644 --- a/src/crush/builder.c +++ b/src/crush/builder.c @@ -339,10 +339,6 @@ crush_make_tree_bucket(int hash, int type, int size, bucket->h.size = size; if (size == 0) { - bucket->h.items = NULL; - bucket->h.weight = 0; - bucket->node_weights = NULL; - bucket->num_nodes = 0; /* printf("size 0 depth 0 nodes 0\n"); */ return bucket; } @@ -572,7 +568,6 @@ crush_make_straw_bucket(struct crush_map *map, if (!bucket->straws) goto err; - bucket->h.weight = 0; for (i=0; ih.items[i] = items[i]; bucket->h.weight += weights[i]; @@ -618,7 +613,6 @@ crush_make_straw2_bucket(struct crush_map *map, if (!bucket->item_weights) goto err; - bucket->h.weight = 0; for (i=0; ih.items[i] = items[i]; bucket->h.weight += weights[i];