Skip to content

Commit

Permalink
xprtrdma: Fix a maybe-uninitialized compiler warning
Browse files Browse the repository at this point in the history
This minor fix-up keeps GCC from complaining that "last' may be used
uninitialized", which breaks some build workflows that have been running
with all warnings treated as errors.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
  • Loading branch information
Benjamin Coddington authored and Trond Myklebust committed Nov 2, 2021
1 parent 8791545 commit cb5a967
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions net/sunrpc/xprtrdma/frwr_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
* a single ib_post_send() call.
*/
prev = &first;
while ((mr = rpcrdma_mr_pop(&req->rl_registered))) {

mr = rpcrdma_mr_pop(&req->rl_registered);
do {
trace_xprtrdma_mr_localinv(mr);
r_xprt->rx_stats.local_inv_needed++;

Expand All @@ -533,7 +533,8 @@ void frwr_unmap_sync(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)

*prev = last;
prev = &last->next;
}
} while ((mr = rpcrdma_mr_pop(&req->rl_registered)));

mr = container_of(last, struct rpcrdma_mr, mr_invwr);

/* Strong send queue ordering guarantees that when the
Expand Down Expand Up @@ -617,8 +618,8 @@ void frwr_unmap_async(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)
* a single ib_post_send() call.
*/
prev = &first;
while ((mr = rpcrdma_mr_pop(&req->rl_registered))) {

mr = rpcrdma_mr_pop(&req->rl_registered);
do {
trace_xprtrdma_mr_localinv(mr);
r_xprt->rx_stats.local_inv_needed++;

Expand All @@ -635,7 +636,7 @@ void frwr_unmap_async(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req)

*prev = last;
prev = &last->next;
}
} while ((mr = rpcrdma_mr_pop(&req->rl_registered)));

/* Strong send queue ordering guarantees that when the
* last WR in the chain completes, all WRs in the chain
Expand Down

0 comments on commit cb5a967

Please sign in to comment.