scsi: myrb: Fix inconsistent format argument types
authorYe Bin <yebin10@huawei.com>
Wed, 30 Sep 2020 02:16:37 +0000 (10:16 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 8 Oct 2020 03:50:04 +0000 (23:50 -0400)
Fix the following warnings:

[drivers/scsi/myrb.c:1052]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/myrb.c:1052]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/myrb.c:1052]: (warning) %d in format string (no. 4)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/myrb.c:2170]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.

Link: https://lore.kernel.org/r/20200930021637.2831618-1-yebin10@huawei.com
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Ye Bin <yebin10@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/myrb.c

index 31c8cbb..48e5386 100644 (file)
@@ -1050,7 +1050,7 @@ static int myrb_get_hba_config(struct myrb_hba *cb)
                enquiry2->fw.turn_id = 0;
        }
        snprintf(cb->fw_version, sizeof(cb->fw_version),
-               "%d.%02d-%c-%02d",
+               "%u.%02u-%c-%02u",
                enquiry2->fw.major_version,
                enquiry2->fw.minor_version,
                enquiry2->fw.firmware_type,
@@ -2167,7 +2167,7 @@ static ssize_t ctlr_num_show(struct device *dev,
        struct Scsi_Host *shost = class_to_shost(dev);
        struct myrb_hba *cb = shost_priv(shost);
 
-       return snprintf(buf, 20, "%d\n", cb->ctlr_num);
+       return snprintf(buf, 20, "%u\n", cb->ctlr_num);
 }
 static DEVICE_ATTR_RO(ctlr_num);