From f3f3d618468716ec889775a01b1731c28b75fb09 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Fri, 1 Nov 2019 18:24:23 -0400 Subject: [PATCH] mon: Convert unsigned enum to int before comparison to zero Signed-off-by: Adam C. Emerson --- src/mon/OSDMonitor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 4a6ce598c6a0..19fe1a93c0d6 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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("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; -- 2.47.3