]> 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)
committerNathan Cutler <ncutler@suse.com>
Wed, 7 Jul 2021 20:45:26 +0000 (22:45 +0200)
commit99ce165dd3aba44768d0b8fe988e1304e4edaa88
tree30b65e102758ff2a0159bd5cea4b6e52215fca23
parentc7d7ab94cb9f720117e83fbff588214b652a2018
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>
(cherry picked from commit 7c2f58ea5ec70e5606ab362e6f4cfda087cec65a)
src/mon/Monitor.cc
src/osd/osd_types.h