]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rbd/Utils.cc: yank features_set_specified and related logic
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 10 May 2017 14:52:54 +0000 (16:52 +0200)
committerKefu Chai <kchai@redhat.com>
Sat, 2 Sep 2017 04:07:20 +0000 (12:07 +0800)
since it isn't used

Fix for:

CID 1394854 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)
 dead_error_line: Execution cannot reach this statement:
 opts->set(RBD_IMAGE_OPTION_....
 Local variable features_set_specified is assigned only once, to a
 constant value, making it effectively constant throughout its scope.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/tools/rbd/Utils.cc

index 549cf9dd8338486d201002ce51baf3a3f1fe89e5..a674e0cab9e28e83758ae1a10cd839bfd93ac600 100644 (file)
@@ -633,12 +633,11 @@ int validate_snapshot_name(at::ArgumentModifier mod,
 int get_image_options(const boost::program_options::variables_map &vm,
                      bool get_format, librbd::ImageOptions *opts) {
   uint64_t order = 0, stripe_unit = 0, stripe_count = 0, object_size = 0;
-  uint64_t features = 0, features_clear = 0, features_set = 0;
+  uint64_t features = 0, features_clear = 0;
   std::string data_pool;
   bool order_specified = true;
   bool features_specified = false;
   bool features_clear_specified = false;
-  bool features_set_specified = false;
   bool stripe_specified = false;
 
   if (vm.count(at::IMAGE_ORDER)) {
@@ -647,7 +646,7 @@ int get_image_options(const boost::program_options::variables_map &vm,
              << std::endl;
   } else if (vm.count(at::IMAGE_OBJECT_SIZE)) {
     object_size = vm[at::IMAGE_OBJECT_SIZE].as<uint64_t>();
-    order = std::round(std::log2(object_size)); 
+    order = std::round(std::log2(object_size));
   } else {
     order_specified = false;
   }
@@ -744,8 +743,6 @@ int get_image_options(const boost::program_options::variables_map &vm,
   if (features_clear_specified) {
     opts->set(RBD_IMAGE_OPTION_FEATURES_CLEAR, features_clear);
   }
-  if (features_set_specified)
-    opts->set(RBD_IMAGE_OPTION_FEATURES_SET, features_set);
   if (stripe_specified) {
     opts->set(RBD_IMAGE_OPTION_STRIPE_UNIT, stripe_unit);
     opts->set(RBD_IMAGE_OPTION_STRIPE_COUNT, stripe_count);