diff options
author | Ralph Campbell <ralph.campbell@qlogic.com> | 2008-01-25 17:17:44 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-01-25 17:17:44 -0500 |
commit | 4e1e93a4189a98cfb0e24865f7f44470ae5f805e (patch) | |
tree | b81f51543d0af51edcbac668d851bf053b84d271 /drivers/infiniband/hw/ipath/ipath_ud.c | |
parent | 950529e5c6efda8a6d3090a8fef9b904c833397a (diff) |
IB/ipath: Trivial simplification of ipath_make_ud_req()
Move the increment of s_hdrwords into the existing if block that tests
if we're doing a send with immediate, to save one test of the opcode.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_ud.c')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_ud.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_ud.c b/drivers/infiniband/hw/ipath/ipath_ud.c index b3df6f3c705e..de67eed08ed0 100644 --- a/drivers/infiniband/hw/ipath/ipath_ud.c +++ b/drivers/infiniband/hw/ipath/ipath_ud.c | |||
@@ -301,8 +301,6 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
301 | 301 | ||
302 | /* header size in 32-bit words LRH+BTH+DETH = (8+12+8)/4. */ | 302 | /* header size in 32-bit words LRH+BTH+DETH = (8+12+8)/4. */ |
303 | qp->s_hdrwords = 7; | 303 | qp->s_hdrwords = 7; |
304 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) | ||
305 | qp->s_hdrwords++; | ||
306 | qp->s_cur_size = wqe->length; | 304 | qp->s_cur_size = wqe->length; |
307 | qp->s_cur_sge = &qp->s_sge; | 305 | qp->s_cur_sge = &qp->s_sge; |
308 | qp->s_wqe = wqe; | 306 | qp->s_wqe = wqe; |
@@ -327,6 +325,7 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
327 | ohdr = &qp->s_hdr.u.oth; | 325 | ohdr = &qp->s_hdr.u.oth; |
328 | } | 326 | } |
329 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) { | 327 | if (wqe->wr.opcode == IB_WR_SEND_WITH_IMM) { |
328 | qp->s_hdrwords++; | ||
330 | ohdr->u.ud.imm_data = wqe->wr.imm_data; | 329 | ohdr->u.ud.imm_data = wqe->wr.imm_data; |
331 | bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24; | 330 | bth0 = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE << 24; |
332 | } else | 331 | } else |