On Tue, 2017-12-12 at 15:08 +0100, Nicolas Morey-Chaisemartin wrote: > +static int poll_cq_once(struct sync_resources *sync_res, struct ibv_cq *cq, > + struct ibv_wc *wc) > +{ > + int ret; > + ret = ibv_poll_cq(cq, 1, wc); Please leave one blank line between declarations and statements. > + if (ret < 0) { > + pr_err("poll CQ failed\n"); > + return ret; > + } > + > + if (ret > 0 && wc->status != IBV_WC_SUCCESS) { > + if (!stop_threads(sync_res)) > + pr_err("got bad completion with status: 0x%x\n", > + wc->status); > + return -ret; > + } > + > + return ret; > +} This function can return negative values, positive values or zero. Please modify it such that either 0 or a negative Unix error code is returned. This will make it easier to read this function and also the code that calls this function. Thanks, Bart. ��.n��������+%������w��{.n�����{���fk��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f