diff options
author | Joe Carnuccio <joe.carnuccio@qlogic.com> | 2016-01-27 12:03:34 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-02-23 21:27:02 -0500 |
commit | da08ef5c30a28745cc789f024a2095f85a4b2b12 (patch) | |
tree | 46afdb0c99054677a17d26ef8513946f6e79d221 /drivers/scsi/qla2xxx/qla_init.c | |
parent | 243de6768db50266f595ec62c5ae34783edb72ea (diff) | |
download | linux-da08ef5c30a28745cc789f024a2095f85a4b2b12.tar.bz2 |
qla2xxx: Avoid side effects when using endianizer macros.
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index cad7c6cb336c..c3aa1eb8c1ba 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -5125,8 +5125,8 @@ qla24xx_nvram_config(scsi_qla_host_t *vha) dptr = (uint32_t *)nv; ha->isp_ops->read_nvram(vha, (uint8_t *)dptr, ha->nvram_base, ha->nvram_size); - for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++) - chksum += le32_to_cpu(*dptr++); + for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++, dptr++) + chksum += le32_to_cpu(*dptr); ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x006a, "Contents of NVRAM\n"); @@ -5379,8 +5379,8 @@ uint8_t qla27xx_find_valid_image(struct scsi_qla_host *vha) wptr = (uint32_t *)(&pri_image_status); cnt = size; - for (chksum = 0; cnt; cnt--) - chksum += le32_to_cpu(*wptr++); + for (chksum = 0; cnt--; wptr++) + chksum += le32_to_cpu(*wptr); if (chksum) { ql_dbg(ql_dbg_init, vha, 0x018c, "Checksum validation failed for primary image (0x%x)\n", @@ -5407,8 +5407,8 @@ check_sec_image: wptr = (uint32_t *)(&sec_image_status); cnt = size; - for (chksum = 0; cnt; cnt--) - chksum += le32_to_cpu(*wptr++); + for (chksum = 0; cnt--; wptr++) + chksum += le32_to_cpu(*wptr); if (chksum) { ql_dbg(ql_dbg_init, vha, 0x018e, "Checksum validation failed for secondary image (0x%x)\n", @@ -6161,8 +6161,8 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) ha->isp_ops->read_optrom(vha, ha->nvram, ha->flt_region_nvram << 2, ha->nvram_size); dptr = (uint32_t *)nv; - for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++) - chksum += le32_to_cpu(*dptr++); + for (cnt = 0, chksum = 0; cnt < ha->nvram_size >> 2; cnt++, dptr++) + chksum += le32_to_cpu(*dptr); ql_dbg(ql_dbg_init + ql_dbg_buffer, vha, 0x0111, "Contents of NVRAM:\n"); |