Commit 3f5f7335 authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type

Since qla82xx_get_fw_size() returns a number in CPU-endian format, change
its return type from __le32 into u32. This patch does not change any
functionality.

Fixes: 9c2b2975 ("[SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.")
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Daniel Wagner <dwagner@suse.de>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Link: https://lore.kernel.org/r/20191219004905.39586-1-bvanassche@acm.orgReviewed-by: default avatarDaniel Wagner <dwagner@suse.de>
Reviewed-by: default avatarRoman Bolshakov <r.bolshakov@yadro.com>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent a27747a2
...@@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_data *ha) ...@@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_data *ha)
return (u8 *)&ha->hablob->fw->data[offset]; return (u8 *)&ha->hablob->fw->data[offset];
} }
static __le32 static u32 qla82xx_get_fw_size(struct qla_hw_data *ha)
qla82xx_get_fw_size(struct qla_hw_data *ha)
{ {
struct qla82xx_uri_data_desc *uri_desc = NULL; struct qla82xx_uri_data_desc *uri_desc = NULL;
...@@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data *ha) ...@@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data *ha)
return cpu_to_le32(uri_desc->size); return cpu_to_le32(uri_desc->size);
} }
return cpu_to_le32(*(u32 *)&ha->hablob->fw->data[FW_SIZE_OFFSET]); return get_unaligned_le32(&ha->hablob->fw->data[FW_SIZE_OFFSET]);
} }
static u8 * static u8 *
...@@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_data *ha) ...@@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_data *ha)
} }
flashaddr = FLASH_ADDR_START; flashaddr = FLASH_ADDR_START;
size = (__force u32)qla82xx_get_fw_size(ha) / 8; size = qla82xx_get_fw_size(ha) / 8;
ptr64 = (u64 *)qla82xx_get_fw_offs(ha); ptr64 = (u64 *)qla82xx_get_fw_offs(ha);
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
......
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