Commit 3b59b7a6 authored by Bart Van Assche's avatar Bart Van Assche Committed by Doug Ledford

IB/srp: Move code out of a loop

Since all srp_map_finish_fr() callers pass a non-zero value as
the fourth argument (sg_nents), the sg_nents == 0 check in that
function can be removed. Add a count == 0 check in the caller
of that function.
Signed-off-by: default avatarBart Van Assche <>
Cc: Christoph Hellwig <>
Cc: Sagi Grimberg <>
Cc: Laurence Oberman <>
Reviewed-by: default avatarSagi Grimberg <>
Reviewed-by: default avatarChristoph Hellwig <>
Signed-off-by: default avatarDoug Ledford <>
parent ffc548bb
......@@ -1315,9 +1315,6 @@ static int srp_map_finish_fr(struct srp_map_state *state,
if (sg_nents == 0)
return 0;
if (sg_nents == 1 && target->global_mr) {
srp_map_desc(state, sg_dma_address(state->sg),
......@@ -1439,6 +1436,9 @@ static int srp_map_sg_fr(struct srp_map_state *state, struct srp_rdma_ch *ch,
state->fr.end = req->fr_list + ch->target->cmd_sg_cnt;
state->sg = scat;
if (count == 0)
return 0;
while (count) {
int i, n;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment