diff --git a/src/connection.cc b/src/connection.cc index 1fce9b89..1fa92126 100644 --- a/src/connection.cc +++ b/src/connection.cc @@ -113,7 +113,7 @@ void IBConnection::flush() { ErrorCode::InternalError); } for (int i = 0; i < wcNum; ++i) { - const struct ibv_wc* wc = reinterpret_cast(qp->getWc(i)); + const ibv_wc* wc = qp->getWc(i); if (wc->status != IBV_WC_SUCCESS) { throw mscclpp::IbError("pollCq failed: status " + std::to_string(wc->status), wc->status); } diff --git a/src/ib.cc b/src/ib.cc index ccccbfc3..f53c93c9 100644 --- a/src/ib.cc +++ b/src/ib.cc @@ -247,7 +247,7 @@ int IbQp::pollCq() { return ibv_poll_cq(this->cq, MSCCLPP_IB_CQ_POLL_NUM, this-> IbQpInfo& IbQp::getInfo() { return this->info; } -const void* IbQp::getWc(int idx) const { return &this->wcs[idx]; } +const ibv_wc* IbQp::getWc(int idx) const { return &this->wcs[idx]; } IbCtx::IbCtx(const std::string& devName) : devName(devName) { int num; diff --git a/src/include/ib.hpp b/src/include/ib.hpp index 6bf86218..6699f432 100644 --- a/src/include/ib.hpp +++ b/src/include/ib.hpp @@ -72,7 +72,7 @@ class IbQp { int pollCq(); IbQpInfo& getInfo(); - const void* getWc(int idx) const; + const ibv_wc* getWc(int idx) const; private: IbQp(ibv_context* ctx, ibv_pd* pd, int port); diff --git a/test/ib_test.cc b/test/ib_test.cc index 753d6fa4..d14586b6 100644 --- a/test/ib_test.cc +++ b/test/ib_test.cc @@ -79,7 +79,7 @@ int main(int argc, const char* argv[]) return 1; } for (int i = 0; i < wcNum; ++i) { - const struct ibv_wc* wc = reinterpret_cast(qp->getWc(i)); + const ibv_wc* wc = qp->getWc(i); if (wc->status != IBV_WC_SUCCESS) { WARN("wc status %d", wc->status); return 1;