Commit 7c56533c authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: correction in the claculation for num_cxn_wrb

This patch correct the math done for num_cxn_wrb
Signed-off-by: default avatarJayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent b30c6dab
...@@ -2042,10 +2042,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba) ...@@ -2042,10 +2042,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
} }
idx = 0; idx = 0;
pwrb = mem_descr_wrb->mem_array[idx].virtual_address; pwrb = mem_descr_wrb->mem_array[idx].virtual_address;
num_cxn_wrb = num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) /
((mem_descr_wrb->mem_array[idx].size) / (sizeof(struct iscsi_wrb)) * ((sizeof(struct iscsi_wrb) *
phba->params.wrbs_per_cxn); phba->params.wrbs_per_cxn));
for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) { for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) {
pwrb_context = &phwi_ctrlr->wrb_context[index]; pwrb_context = &phwi_ctrlr->wrb_context[index];
if (num_cxn_wrb) { if (num_cxn_wrb) {
...@@ -2058,9 +2057,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba) ...@@ -2058,9 +2057,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba)
} else { } else {
idx++; idx++;
pwrb = mem_descr_wrb->mem_array[idx].virtual_address; pwrb = mem_descr_wrb->mem_array[idx].virtual_address;
num_cxn_wrb = ((mem_descr_wrb->mem_array[idx].size) / num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) /
(sizeof(struct iscsi_wrb)) * ((sizeof(struct iscsi_wrb) *
phba->params.wrbs_per_cxn); phba->params.wrbs_per_cxn));
for (j = 0; j < phba->params.wrbs_per_cxn; j++) { for (j = 0; j < phba->params.wrbs_per_cxn; j++) {
pwrb_handle = pwrb_context->pwrb_handle_base[j]; pwrb_handle = pwrb_context->pwrb_handle_base[j];
pwrb_handle->pwrb = pwrb; pwrb_handle->pwrb = pwrb;
......
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