Commit bf9b7554 authored by Jitendra Bhivare's avatar Jitendra Bhivare Committed by Martin K. Petersen

scsi: be2iscsi: Remove redundant iscsi_wrb desc memset

alloc_wrb_handle already does memset zero of iscsi_wrb descriptor so
remove redundant memset in WRB submission paths.

Add pwrb_handle NULL check before memsett'ing pwrb.
Signed-off-by: default avatarJitendra Bhivare <jitendra.bhivare@broadcom.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent deeea8ed
...@@ -967,6 +967,8 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, ...@@ -967,6 +967,8 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,
else else
pwrb_context->alloc_index++; pwrb_context->alloc_index++;
spin_unlock_bh(&pwrb_context->wrb_lock); spin_unlock_bh(&pwrb_context->wrb_lock);
if (pwrb_handle)
memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb)); memset(pwrb_handle->pwrb, 0, sizeof(*pwrb_handle->pwrb));
return pwrb_handle; return pwrb_handle;
...@@ -4718,7 +4720,6 @@ static int beiscsi_mtask(struct iscsi_task *task) ...@@ -4718,7 +4720,6 @@ static int beiscsi_mtask(struct iscsi_task *task)
cid = beiscsi_conn->beiscsi_conn_cid; cid = beiscsi_conn->beiscsi_conn_cid;
pwrb = io_task->pwrb_handle->pwrb; pwrb = io_task->pwrb_handle->pwrb;
memset(pwrb, 0, sizeof(*pwrb));
if (is_chip_be2_be3r(phba)) { if (is_chip_be2_be3r(phba)) {
AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb, AMAP_SET_BITS(struct amap_iscsi_wrb, cmdsn_itt, pwrb,
......
...@@ -1350,7 +1350,6 @@ void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, ...@@ -1350,7 +1350,6 @@ void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params,
{ {
struct iscsi_wrb *pwrb = pwrb_handle->pwrb; struct iscsi_wrb *pwrb = pwrb_handle->pwrb;
memset(pwrb, 0, sizeof(*pwrb));
AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb, AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb,
max_send_data_segment_length, pwrb, max_send_data_segment_length, pwrb,
params->dw[offsetof(struct amap_beiscsi_offload_params, params->dw[offsetof(struct amap_beiscsi_offload_params,
...@@ -1422,8 +1421,6 @@ void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params, ...@@ -1422,8 +1421,6 @@ void beiscsi_offload_cxn_v2(struct beiscsi_offload_params *params,
{ {
struct iscsi_wrb *pwrb = pwrb_handle->pwrb; struct iscsi_wrb *pwrb = pwrb_handle->pwrb;
memset(pwrb, 0, sizeof(*pwrb));
AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb_v2, AMAP_SET_BITS(struct amap_iscsi_target_context_update_wrb_v2,
max_burst_length, pwrb, params->dw[offsetof max_burst_length, pwrb, params->dw[offsetof
(struct amap_beiscsi_offload_params, (struct amap_beiscsi_offload_params,
......
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