qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type
Subsystems (2)
PATCH 1/1 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.
--- drivers/scsi/qla2xxx/qla_nx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/scsi/qla2xxx/qla_nx.c +3 -4
@@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_data *ha)return (u8 *)&ha->hablob->fw->data[offset]; } -static __le32 -qla82xx_get_fw_size (struct qla_hw_data *ha) +static u32 qla82xx_get_fw_size (struct qla_hw_data *ha) {struct qla82xx_uri_data_desc *uri_desc =NULL ;
@@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data *ha)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 *
@@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_data *ha) } 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);for (i =0 ; i < size; i++) {
Quoted 11 lines · Bart Van Assche
Since
qla82xx_get_fw_size()returns a number in CPU-endian format, change its return type from__le32into u32. This patch does not change any functionality.Cc Himanshu Madhani <[email protected]>Cc Quinn Tran <[email protected]>Cc Martin Wilck <[email protected]>Cc Daniel Wagner <[email protected]>Cc Roman Bolshakov <[email protected]>Fixes 9c2b297572bf ("[SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.")Signed-off-by Bart Van Assche <[email protected]>
Quoted 36 lines
--- drivers/scsi/qla2xxx/qla_nx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/scsi/qla2xxx/qla_nx.c +3
-4@@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_data *ha)return (u8 *)&ha->hablob->fw->data[offset]; } -static __le32 -qla82xx_get_fw_size (struct qla_hw_data *ha) +static u32 qla82xx_get_fw_size (struct qla_hw_data *ha) {struct qla82xx_uri_data_desc *uri_desc =NULL ;@@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data *ha)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 *@@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_data *ha) } 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);for (i =0 ; i < size; i++) {
Quoted 11 lines · Bart Van Assche
Since
qla82xx_get_fw_size()returns a number in CPU-endian format, change its return type from__le32into u32. This patch does not change any functionality.Cc Himanshu Madhani <[email protected]>Cc Quinn Tran <[email protected]>Cc Martin Wilck <[email protected]>Cc Daniel Wagner <[email protected]>Cc Roman Bolshakov <[email protected]>Fixes 9c2b297572bf ("[SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.")Signed-off-by Bart Van Assche <[email protected]>
Quoted 4 lines
--- drivers/scsi/qla2xxx/qla_nx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Thank you,
Roman
Martin K. Petersen
AppliedBart,
Quoted 3 lines
Since
qla82xx_get_fw_size()returns a number in CPU-endian format, change its return type from__le32into u32. This patch does not change any functionality.
Applied to 5.6/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering