]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: Convert unsigned enum to int before comparison to zero
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 1 Nov 2019 22:24:23 +0000 (18:24 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Sat, 2 Nov 2019 05:37:09 +0000 (01:37 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/mon/OSDMonitor.cc

index 4a6ce598c6a0baf2517ccbf905e8bd0ad7e6b8f7..19fe1a93c0d647131932098cf69dd9447746dfcd 100644 (file)
@@ -12891,7 +12891,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     string modestr;
     cmd_getval(cct, cmdmap, "mode", modestr);
     pg_pool_t::cache_mode_t mode = pg_pool_t::get_cache_mode_from_str(modestr);
-    if (mode < 0) {
+    if (int(mode) < 0) {
       ss << "'" << modestr << "' is not a valid cache mode";
       err = -EINVAL;
       goto reply;
@@ -13060,7 +13060,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
     }
     auto& modestr = g_conf().get_val<string>("osd_tier_default_cache_mode");
     pg_pool_t::cache_mode_t mode = pg_pool_t::get_cache_mode_from_str(modestr);
-    if (mode < 0) {
+    if (int(mode) < 0) {
       ss << "osd tier cache default mode '" << modestr << "' is not a valid cache mode";
       err = -EINVAL;
       goto reply;