Commit 10fce586 authored by Bart Van Assche's avatar Bart Van Assche Committed by Doug Ledford

IB/srpt: Simplify srpt_queue_response()

Initialize first_wr to &send_wr. This allows to remove a ternary
operator and an else branch. This patch does not change the behavior
of srpt_queue_response().
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Tested-by: default avatarSteve Wise <swise@opengridcomputing.com>
Tested-by: default avatarLaurence Oberman <loberman@redhat.com>
Cc: Parav Pandit <pandit.parav@gmail.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 30c6d877
...@@ -2262,7 +2262,7 @@ static void srpt_queue_response(struct se_cmd *cmd) ...@@ -2262,7 +2262,7 @@ static void srpt_queue_response(struct se_cmd *cmd)
container_of(cmd, struct srpt_send_ioctx, cmd); container_of(cmd, struct srpt_send_ioctx, cmd);
struct srpt_rdma_ch *ch = ioctx->ch; struct srpt_rdma_ch *ch = ioctx->ch;
struct srpt_device *sdev = ch->sport->sdev; struct srpt_device *sdev = ch->sport->sdev;
struct ib_send_wr send_wr, *first_wr = NULL, *bad_wr; struct ib_send_wr send_wr, *first_wr = &send_wr, *bad_wr;
struct ib_sge sge; struct ib_sge sge;
enum srpt_command_state state; enum srpt_command_state state;
unsigned long flags; unsigned long flags;
...@@ -2303,11 +2303,8 @@ static void srpt_queue_response(struct se_cmd *cmd) ...@@ -2303,11 +2303,8 @@ static void srpt_queue_response(struct se_cmd *cmd)
struct srpt_rw_ctx *ctx = &ioctx->rw_ctxs[i]; struct srpt_rw_ctx *ctx = &ioctx->rw_ctxs[i];
first_wr = rdma_rw_ctx_wrs(&ctx->rw, ch->qp, first_wr = rdma_rw_ctx_wrs(&ctx->rw, ch->qp,
ch->sport->port, NULL, ch->sport->port, NULL, first_wr);
first_wr ? first_wr : &send_wr);
} }
} else {
first_wr = &send_wr;
} }
if (state != SRPT_STATE_MGMT) if (state != SRPT_STATE_MGMT)
......
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