wwbmmm commented on code in PR #3034: URL: https://github.com/apache/brpc/pull/3034#discussion_r2218763615
########## src/brpc/rdma/rdma_endpoint.cpp: ########## @@ -878,10 +878,13 @@ ssize_t RdmaEndpoint::CutFromIOBufList(butil::IOBuf** from, size_t ndata) { } ibv_send_wr* bad = NULL; - if (ibv_post_send(_resource->qp, &wr, &bad) < 0) { + if (int err = ibv_post_send(_resource->qp, &wr, &bad)) { Review Comment: int err = xxx(); if (err != 0) { } the same below ########## src/brpc/rdma/rdma_helper.cpp: ########## @@ -522,7 +522,7 @@ static void GlobalRdmaInitializeOrDieImpl() { } ibv_device_attr attr; - if (IbvQueryDevice(g_context, &attr) < 0) { + if (IbvQueryDevice(g_context, &attr)) { Review Comment: add "!= 0" ########## src/brpc/rdma/rdma_helper.cpp: ########## @@ -405,7 +405,7 @@ static ibv_context* OpenDevice(int num_total, int* num_available_devices) { continue; } ibv_port_attr attr; - if (IbvQueryPort(context.get(), uint8_t(FLAGS_rdma_port), &attr) < 0) { + if ((errno = IbvQueryPort(context.get(), uint8_t(FLAGS_rdma_port), &attr))) { Review Comment: errno = xxx() if (errno != 0) { } ########## src/brpc/rdma/rdma_endpoint.cpp: ########## @@ -1392,7 +1395,7 @@ void RdmaEndpoint::PollCq(Socket* m) { // that the event arrives after the poll but before the notify, // we should re-poll the CQ once after the notify to check if // there is an available CQE. - if (ibv_req_notify_cq(ep->_resource->cq, 1) < 0) { + if ((errno = ibv_req_notify_cq(ep->_resource->cq, 1))) { Review Comment: errno = xxx() if (errno != 0) { } ########## src/brpc/rdma/rdma_helper.cpp: ########## @@ -203,7 +203,7 @@ void BlockDeallocate(void* buf) { static void FindRdmaLid() { ibv_port_attr attr; - if (IbvQueryPort(g_context, g_port_num, &attr) < 0) { + if (IbvQueryPort(g_context, g_port_num, &attr)) { Review Comment: add "!= 0" -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org