]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon,osd: always init local variable
authorKefu Chai <kchai@redhat.com>
Mon, 12 Apr 2021 09:32:59 +0000 (17:32 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 12 Apr 2021 09:35:34 +0000 (17:35 +0800)
commit7c2f58ea5ec70e5606ab362e6f4cfda087cec65a
tree3a6df2bfef86dd8f826334627449a02150af7453
parentff79cae5a1243111c8a039426081638d40a258fa
mon,osd: always init local variable

this change silences the warning like:

../src/mon/Monitor.cc: In member function ‘void Monitor::handle_command(MonOpRequestRef)’:
../src/mon/Monitor.cc:3703:55: warning: ‘osd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 3703 |     uint64_t seq = mgrstatmon()->get_last_osd_stat_seq(osd);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/Monitor.cc
src/osd/osd_types.h