]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: Quell unused variable warnings
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 29 Aug 2018 17:25:20 +0000 (13:25 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Wed, 12 Sep 2018 15:37:28 +0000 (11:37 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/crush/CrushWrapper.cc
src/crush/builder.c

index c1cbc2936aa9fa3985558eda708b4366a3713f48..f5585a1bb106ccadb86a6af6df20191df88818ff 100644 (file)
@@ -1062,8 +1062,8 @@ int CrushWrapper::insert_item(
 
     ldout(cct, 5) << "insert_item adding " << cur << " weight " << weight
                  << " to bucket " << id << dendl;
-    int r = bucket_add_item(b, cur, 0);
-    assert (!r);
+    [[maybe_unused]] int r = bucket_add_item(b, cur, 0);
+    ceph_assert(!r);
     break;
   }
 
index be8b5e24cebcac4fc24988d5b0fc35dfc1e114c4..53a6e1b91ef64a101fe9ac1fd41024af730d87c0 100644 (file)
@@ -1426,10 +1426,10 @@ struct crush_choose_arg *crush_make_choose_args(struct crush_map *map, int num_p
   struct crush_choose_arg *arg = (struct crush_choose_arg *)space;
   struct crush_weight_set *weight_set = (struct crush_weight_set *)(arg + map->max_buckets);
   __u32 *weights = (__u32 *)(weight_set + bucket_count * num_positions);
-  char *weight_set_ends = (char*)weights;
+  char *weight_set_ends __attribute__((unused)) = (char*)weights;
   __s32 *ids = (__s32 *)(weights + sum_bucket_size * num_positions);
-  char *weights_end = (char *)ids;
-  char *ids_end = (char *)(ids + sum_bucket_size);
+  char *weights_end __attribute__((unused)) = (char *)ids;
+  char *ids_end __attribute__((unused)) = (char *)(ids + sum_bucket_size);
   BUG_ON(space + size != ids_end);
   for (b = 0; b < map->max_buckets; b++) {
     if (map->buckets[b] == 0) {