mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-09-22 04:31:58 +08:00
scsi: pm8001: Fix pm8001_update_flash() local variable type
Change the type of partitionSizeTmp from u32 to __be32 to suppress the sparse warning: warning: cast to restricted __be32 Link: https://lore.kernel.org/r/20220220031810.738362-4-damien.lemoal@opensource.wdc.com Reviewed-by: Jack Wang <jinpu.wang@ionos.com> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
d2ed913b9a
commit
c58e935e80
@ -721,7 +721,8 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)
|
||||
DECLARE_COMPLETION_ONSTACK(completion);
|
||||
u8 *ioctlbuffer;
|
||||
struct fw_control_info *fwControl;
|
||||
u32 partitionSize, partitionSizeTmp;
|
||||
__be32 partitionSizeTmp;
|
||||
u32 partitionSize;
|
||||
u32 loopNumber, loopcount;
|
||||
struct pm8001_fw_image_header *image_hdr;
|
||||
u32 sizeRead = 0;
|
||||
@ -742,7 +743,7 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)
|
||||
image_hdr = (struct pm8001_fw_image_header *)pm8001_ha->fw_image->data;
|
||||
while (sizeRead < pm8001_ha->fw_image->size) {
|
||||
partitionSizeTmp =
|
||||
*(u32 *)((u8 *)&image_hdr->image_length + sizeRead);
|
||||
*(__be32 *)((u8 *)&image_hdr->image_length + sizeRead);
|
||||
partitionSize = be32_to_cpu(partitionSizeTmp);
|
||||
loopcount = DIV_ROUND_UP(partitionSize + HEADER_LEN,
|
||||
IOCTL_BUF_SIZE);
|
||||
|
Loading…
Reference in New Issue
Block a user