From: Danny Al-Gaaf Date: Wed, 10 May 2017 14:52:54 +0000 (+0200) Subject: tools/rbd/Utils.cc: yank features_set_specified and related logic X-Git-Tag: v13.0.1~1052^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a02aca31738137438185c9524284b45568563ee0;p=ceph-ci.git tools/rbd/Utils.cc: yank features_set_specified and related logic 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 --- diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index 549cf9dd833..a674e0cab9e 100644 --- a/src/tools/rbd/Utils.cc +++ b/src/tools/rbd/Utils.cc @@ -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(); - 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);