Skip to content

Commit

Permalink
Merge pull request #13473 from tchaikov/wip-coverity-fixes
Browse files Browse the repository at this point in the history
msg, messages: coverity fixes

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
tchaikov committed Feb 18, 2017
2 parents 0603794 + 6e28549 commit 780f4c0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
22 changes: 17 additions & 5 deletions src/common/perf_histogram.h
Expand Up @@ -30,11 +30,23 @@ class PerfHistogramCommon {
};

struct axis_config_d {
const char *m_name;
scale_type_d m_scale_type;
int64_t m_min;
int64_t m_quant_size;
int32_t m_buckets;
const char *m_name = nullptr;
scale_type_d m_scale_type = SCALE_LINEAR;
int64_t m_min = 0;
int64_t m_quant_size = 0;
int32_t m_buckets = 0;
axis_config_d() = default;
axis_config_d(const char* name,
scale_type_d scale_type,
int64_t min,
int64_t quant_size,
int32_t buckets)
: m_name(name),
m_scale_type(scale_type),
m_min(min),
m_quant_size(quant_size),
m_buckets(buckets)
{}
};

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/messages/MOSDBackoff.h
Expand Up @@ -21,8 +21,8 @@

class MOSDBackoff : public MOSDFastDispatchOp {
public:
const int HEAD_VERSION = 1;
const int COMPAT_VERSION = 1;
static constexpr int HEAD_VERSION = 1;
static constexpr int COMPAT_VERSION = 1;

spg_t pgid;
epoch_t map_epoch = 0;
Expand Down
3 changes: 0 additions & 3 deletions src/msg/async/AsyncConnection.cc
Expand Up @@ -1074,7 +1074,6 @@ ssize_t AsyncConnection::_process_connection()
}

connect_reply = *((ceph_msg_connect_reply*)state_buffer);
connect_reply.features = connect_reply.features;

ldout(async_msgr->cct, 20) << __func__ << " connect got reply tag " << (int)connect_reply.tag
<< " connect_seq " << connect_reply.connect_seq << " global_seq "
Expand Down Expand Up @@ -1286,8 +1285,6 @@ ssize_t AsyncConnection::_process_connection()
}

connect_msg = *((ceph_msg_connect*)state_buffer);
// sanitize features
connect_msg.features = connect_msg.features;
state = STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH;
break;
}
Expand Down
6 changes: 0 additions & 6 deletions src/msg/simple/Pipe.cc
Expand Up @@ -427,9 +427,6 @@ int Pipe::accept()
goto fail_unlocked;
}

// sanitize features
connect.features = connect.features;

authorizer.clear();
if (connect.authorizer_len) {
bp = buffer::create(connect.authorizer_len);
Expand Down Expand Up @@ -1161,9 +1158,6 @@ int Pipe::connect()
goto fail;
}

// sanitize features
reply.features = reply.features;

ldout(msgr->cct,20) << "connect got reply tag " << (int)reply.tag
<< " connect_seq " << reply.connect_seq
<< " global_seq " << reply.global_seq
Expand Down

0 comments on commit 780f4c0

Please sign in to comment.