Commit 106b7a25 authored by Yang Li's avatar Yang Li Committed by Martin K. Petersen

scsi: pm8001: Clean up inconsistent indenting

Eliminate the following smatch warning:

drivers/scsi/pm8001/pm8001_ctl.c:760 pm8001_update_flash() warn:
inconsistent indenting

Link: https://lore.kernel.org/r/20220208025500.29511-1-yang.lee@linux.alibaba.comReported-by: default avatarAbaci Robot <abaci@linux.alibaba.com>
Acked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarYang Li <yang.lee@linux.alibaba.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 03e4383c
...@@ -727,6 +727,8 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha) ...@@ -727,6 +727,8 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)
u32 sizeRead = 0; u32 sizeRead = 0;
u32 ret = 0; u32 ret = 0;
u32 length = 1024 * 16 + sizeof(*payload) - 1; u32 length = 1024 * 16 + sizeof(*payload) - 1;
u32 fc_len;
u8 *read_buf;
if (pm8001_ha->fw_image->size < 28) { if (pm8001_ha->fw_image->size < 28) {
pm8001_ha->fw_status = FAIL_FILE_SIZE; pm8001_ha->fw_status = FAIL_FILE_SIZE;
...@@ -755,36 +757,35 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha) ...@@ -755,36 +757,35 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha)
fwControl->retcode = 0;/* OUT */ fwControl->retcode = 0;/* OUT */
fwControl->offset = loopNumber * IOCTL_BUF_SIZE;/*OUT */ fwControl->offset = loopNumber * IOCTL_BUF_SIZE;/*OUT */
/* for the last chunk of data in case file size is not even with /*
4k, load only the rest*/ * for the last chunk of data in case file size is
if (((loopcount-loopNumber) == 1) && * not even with 4k, load only the rest
((partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE)) { */
fwControl->len =
(partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE; read_buf = (u8 *)pm8001_ha->fw_image->data + sizeRead;
memcpy((u8 *)fwControl->buffer, fc_len = (partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE;
(u8 *)pm8001_ha->fw_image->data + sizeRead,
(partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE); if (loopcount - loopNumber == 1 && fc_len) {
sizeRead += fwControl->len = fc_len;
(partitionSize + HEADER_LEN) % IOCTL_BUF_SIZE; memcpy((u8 *)fwControl->buffer, read_buf, fc_len);
} else { sizeRead += fc_len;
memcpy((u8 *)fwControl->buffer, } else {
(u8 *)pm8001_ha->fw_image->data + sizeRead, memcpy((u8 *)fwControl->buffer, read_buf, IOCTL_BUF_SIZE);
IOCTL_BUF_SIZE); sizeRead += IOCTL_BUF_SIZE;
sizeRead += IOCTL_BUF_SIZE; }
}
pm8001_ha->nvmd_completion = &completion;
pm8001_ha->nvmd_completion = &completion; ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload);
ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload); if (ret) {
if (ret) { pm8001_ha->fw_status = FAIL_OUT_MEMORY;
pm8001_ha->fw_status = FAIL_OUT_MEMORY; goto out;
goto out; }
} wait_for_completion(&completion);
wait_for_completion(&completion); if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) {
if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { pm8001_ha->fw_status = fwControl->retcode;
pm8001_ha->fw_status = fwControl->retcode; ret = -EFAULT;
ret = -EFAULT; goto out;
goto out; }
}
} }
} }
out: out:
......
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