diff options
author | Jayamohan Kallickal <jayamohank@serverengines.com> | 2010-01-22 19:09:37 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-02-08 19:34:20 -0500 |
commit | 7c56533cf4fb072abc39e850e7ef4fb6166cc83b (patch) | |
tree | 7e19ac848d2d351708a577acd74542e0c4ae84a8 | |
parent | b30c6dab1d87cc638a7413dd0e778d8c9a5232eb (diff) |
[SCSI] be2iscsi: correction in the claculation for num_cxn_wrb
This patch correct the math done for num_cxn_wrb
Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 932cb8ab8db6..687d535894a9 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -2042,10 +2042,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba) | |||
2042 | } | 2042 | } |
2043 | idx = 0; | 2043 | idx = 0; |
2044 | pwrb = mem_descr_wrb->mem_array[idx].virtual_address; | 2044 | pwrb = mem_descr_wrb->mem_array[idx].virtual_address; |
2045 | num_cxn_wrb = | 2045 | num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) / |
2046 | ((mem_descr_wrb->mem_array[idx].size) / (sizeof(struct iscsi_wrb)) * | 2046 | ((sizeof(struct iscsi_wrb) * |
2047 | phba->params.wrbs_per_cxn); | 2047 | phba->params.wrbs_per_cxn)); |
2048 | |||
2049 | for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) { | 2048 | for (index = 0; index < phba->params.cxns_per_ctrl; index += 2) { |
2050 | pwrb_context = &phwi_ctrlr->wrb_context[index]; | 2049 | pwrb_context = &phwi_ctrlr->wrb_context[index]; |
2051 | if (num_cxn_wrb) { | 2050 | if (num_cxn_wrb) { |
@@ -2058,9 +2057,9 @@ static void beiscsi_init_wrb_handle(struct beiscsi_hba *phba) | |||
2058 | } else { | 2057 | } else { |
2059 | idx++; | 2058 | idx++; |
2060 | pwrb = mem_descr_wrb->mem_array[idx].virtual_address; | 2059 | pwrb = mem_descr_wrb->mem_array[idx].virtual_address; |
2061 | num_cxn_wrb = ((mem_descr_wrb->mem_array[idx].size) / | 2060 | num_cxn_wrb = (mem_descr_wrb->mem_array[idx].size) / |
2062 | (sizeof(struct iscsi_wrb)) * | 2061 | ((sizeof(struct iscsi_wrb) * |
2063 | phba->params.wrbs_per_cxn); | 2062 | phba->params.wrbs_per_cxn)); |
2064 | for (j = 0; j < phba->params.wrbs_per_cxn; j++) { | 2063 | for (j = 0; j < phba->params.wrbs_per_cxn; j++) { |
2065 | pwrb_handle = pwrb_context->pwrb_handle_base[j]; | 2064 | pwrb_handle = pwrb_context->pwrb_handle_base[j]; |
2066 | pwrb_handle->pwrb = pwrb; | 2065 | pwrb_handle->pwrb = pwrb; |