diff options
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 303f8ee11f25..afec7f90f58a 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -982,7 +982,7 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, | |||
982 | int ret; | 982 | int ret; |
983 | uint32_t liter, miter; | 983 | uint32_t liter, miter; |
984 | uint32_t sec_mask, rest_addr; | 984 | uint32_t sec_mask, rest_addr; |
985 | uint32_t fdata, findex; | 985 | uint32_t fdata; |
986 | dma_addr_t optrom_dma; | 986 | dma_addr_t optrom_dma; |
987 | void *optrom = NULL; | 987 | void *optrom = NULL; |
988 | uint32_t *s, *d; | 988 | uint32_t *s, *d; |
@@ -1003,17 +1003,15 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, | |||
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | rest_addr = (ha->fdt_block_size >> 2) - 1; | 1005 | rest_addr = (ha->fdt_block_size >> 2) - 1; |
1006 | sec_mask = (ha->optrom_size >> 2) - (ha->fdt_block_size >> 2); | 1006 | sec_mask = ~rest_addr; |
1007 | 1007 | ||
1008 | qla24xx_unprotect_flash(ha); | 1008 | qla24xx_unprotect_flash(ha); |
1009 | 1009 | ||
1010 | for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) { | 1010 | for (liter = 0; liter < dwords; liter++, faddr++, dwptr++) { |
1011 | 1011 | fdata = (faddr & sec_mask) << 2; | |
1012 | findex = faddr; | ||
1013 | fdata = (findex & sec_mask) << 2; | ||
1014 | 1012 | ||
1015 | /* Are we at the beginning of a sector? */ | 1013 | /* Are we at the beginning of a sector? */ |
1016 | if ((findex & rest_addr) == 0) { | 1014 | if ((faddr & rest_addr) == 0) { |
1017 | /* Do sector unprotect. */ | 1015 | /* Do sector unprotect. */ |
1018 | if (ha->fdt_unprotect_sec_cmd) | 1016 | if (ha->fdt_unprotect_sec_cmd) |
1019 | qla24xx_write_flash_dword(ha, | 1017 | qla24xx_write_flash_dword(ha, |