From 89eb6b5eb635e0ff615ef50556454e0e61ebe898 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 13 Sep 2011 18:45:13 +0000 Subject: [PATCH] ib_srpt: Builds again on 32-bit systems (backported r3815 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3852 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index d53e1c1aa..4dae12381 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -1110,7 +1110,7 @@ static int srpt_ch_qp_rts(struct srpt_rdma_ch *ch, struct ib_qp *qp) int attr_mask; int ret; uint64_t T_tr_ns; - uint32_t max_compl_time_ms; + uint32_t T_tr_ms, max_compl_time_ms; TRACE_ENTRY(); @@ -1133,11 +1133,13 @@ static int srpt_ch_qp_rts(struct srpt_rdma_ch *ch, struct ib_qp *qp) WARN_ON(attr->timeout >= (1 << 5)); if (attr->timeout) { T_tr_ns = 1ULL << (12 + attr->timeout); - max_compl_time_ms = attr->retry_cnt * 4 * T_tr_ns / 1000000; + max_compl_time_ms = attr->retry_cnt * 4 * T_tr_ns; + do_div(max_compl_time_ms, 1000000); + T_tr_ms = T_tr_ns; + do_div(T_tr_ms, 1000000); TRACE_DBG("Session %s: QP local ack timeout = %d or T_tr =" " %u ms; retry_cnt = %d; max compl. time = %d ms", - ch->sess_name, - attr->timeout, (unsigned)(T_tr_ns / (1000 * 1000)), + ch->sess_name, attr->timeout, T_tr_ms, attr->retry_cnt, max_compl_time_ms); if (max_compl_time_ms >= RDMA_COMPL_TIMEOUT_S * 1000) {