Message ID | 20200930021527.2831077-1-yebin10@huawei.com |
---|---|
State | New |
Headers | show |
Series | scsi: esas2r: Fix inconsistent of format with argument type | expand |
Hello Ye, > @@ -310,7 +310,7 @@ static void esas2r_complete_vda_ioctl(struct esas2r_adapter *a, > le32_to_cpu(rsp->vda_version); > cfg->data.init.fw_build = rsp->fw_build; > > - snprintf(buf, sizeof(buf), "%1.1u.%2.2u", > + snprintf(buf, sizeof(buf), "%1.1d.%2.2d", > (int)LOBYTE(le16_to_cpu(rsp->fw_release)), > (int)HIBYTE(le16_to_cpu(rsp->fw_release))); I doubt the firmware release is a negative number.
diff --git a/drivers/scsi/esas2r/esas2r_vda.c b/drivers/scsi/esas2r/esas2r_vda.c index 30028e56df63..e655b87ddb6b 100644 --- a/drivers/scsi/esas2r/esas2r_vda.c +++ b/drivers/scsi/esas2r/esas2r_vda.c @@ -310,7 +310,7 @@ static void esas2r_complete_vda_ioctl(struct esas2r_adapter *a, le32_to_cpu(rsp->vda_version); cfg->data.init.fw_build = rsp->fw_build; - snprintf(buf, sizeof(buf), "%1.1u.%2.2u", + snprintf(buf, sizeof(buf), "%1.1d.%2.2d", (int)LOBYTE(le16_to_cpu(rsp->fw_release)), (int)HIBYTE(le16_to_cpu(rsp->fw_release)));
Fix follow warnings: [drivers/scsi/esas2r/esas2r_vda.c:313]: (warning) %u in format string (no. 1) requires 'unsigned int' but the argument type is 'signed int'. [drivers/scsi/esas2r/esas2r_vda.c:313]: (warning) %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> --- drivers/scsi/esas2r/esas2r_vda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)