Message ID | 20200930022515.2862532-3-yebin10@huawei.com |
---|---|
State | New |
Headers | show |
Series | Fix inconsistent of format with argument type | expand |
> -----Original Message----- > From: Ye Bin <yebin10@huawei.com> > Sent: Wednesday, September 30, 2020 7:55 AM > To: Nilesh Javali <njavali@marvell.com>; GR-QLogic-Storage-Upstream <GR- > QLogic-Storage-Upstream@marvell.com>; linux-scsi@vger.kernel.org > Cc: Ye Bin <yebin10@huawei.com>; Hulk Robot <hulkci@huawei.com> > Subject: [PATCH 2/3] scsi: qla2xxx: Fix inconsistent of format with argument > type in qla_os.c > > Fix follow warning: > [drivers/scsi/qla2xxx/qla_os.c:4882]: (warning) %ld in format string (no. 2) > requires 'long' but the argument type is 'unsigned long'. > [drivers/scsi/qla2xxx/qla_os.c:5011]: (warning) %ld in format string (no. 1) > requires 'long' but the argument type is 'unsigned long'. > > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Ye Bin <yebin10@huawei.com> > --- > drivers/scsi/qla2xxx/qla_os.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c > index 910a6ed0ccc7..473a02603697 100644 > --- a/drivers/scsi/qla2xxx/qla_os.c > +++ b/drivers/scsi/qla2xxx/qla_os.c > @@ -4879,7 +4879,7 @@ struct scsi_qla_host *qla2x00_create_host(struct > scsi_host_template *sht, > } > INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); > > - sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha- > >host_no); > + sprintf(vha->host_str, "%s_%lu", QLA2XXX_DRIVER_NAME, vha- > >host_no); > ql_dbg(ql_dbg_init, vha, 0x0041, > "Allocated the host=%p hw=%p vha=%p dev_name=%s", > vha->host, vha->hw, vha, > @@ -5008,7 +5008,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, > u32 code) > > switch (code) { > case QLA_UEVENT_CODE_FW_DUMP: > - snprintf(event_string, sizeof(event_string), "FW_DUMP=%ld", > + snprintf(event_string, sizeof(event_string), "FW_DUMP=%lu", > vha->host_no); > break; > default: > -- > 2.25.4 Reviewed-by: Nilesh Javali <njavali@marvell.com>
> On Sep 29, 2020, at 9:25 PM, Ye Bin <yebin10@huawei.com> wrote: > > Fix follow warning: > [drivers/scsi/qla2xxx/qla_os.c:4882]: (warning) %ld in format string (no. 2) > requires 'long' but the argument type is 'unsigned long'. > [drivers/scsi/qla2xxx/qla_os.c:5011]: (warning) %ld in format string (no. 1) > requires 'long' but the argument type is 'unsigned long'. > > Reported-by: Hulk Robot <hulkci@huawei.com> > Signed-off-by: Ye Bin <yebin10@huawei.com> > --- > drivers/scsi/qla2xxx/qla_os.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c > index 910a6ed0ccc7..473a02603697 100644 > --- a/drivers/scsi/qla2xxx/qla_os.c > +++ b/drivers/scsi/qla2xxx/qla_os.c > @@ -4879,7 +4879,7 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht, > } > INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); > > - sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no); > + sprintf(vha->host_str, "%s_%lu", QLA2XXX_DRIVER_NAME, vha->host_no); > ql_dbg(ql_dbg_init, vha, 0x0041, > "Allocated the host=%p hw=%p vha=%p dev_name=%s", > vha->host, vha->hw, vha, > @@ -5008,7 +5008,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code) > > switch (code) { > case QLA_UEVENT_CODE_FW_DUMP: > - snprintf(event_string, sizeof(event_string), "FW_DUMP=%ld", > + snprintf(event_string, sizeof(event_string), "FW_DUMP=%lu", > vha->host_no); > break; > default: > -- > 2.25.4 > Looks good. Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> -- Himanshu Madhani Oracle Linux Engineering
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 910a6ed0ccc7..473a02603697 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4879,7 +4879,7 @@ struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht, } INIT_DELAYED_WORK(&vha->scan.scan_work, qla_scan_work_fn); - sprintf(vha->host_str, "%s_%ld", QLA2XXX_DRIVER_NAME, vha->host_no); + sprintf(vha->host_str, "%s_%lu", QLA2XXX_DRIVER_NAME, vha->host_no); ql_dbg(ql_dbg_init, vha, 0x0041, "Allocated the host=%p hw=%p vha=%p dev_name=%s", vha->host, vha->hw, vha, @@ -5008,7 +5008,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code) switch (code) { case QLA_UEVENT_CODE_FW_DUMP: - snprintf(event_string, sizeof(event_string), "FW_DUMP=%ld", + snprintf(event_string, sizeof(event_string), "FW_DUMP=%lu", vha->host_no); break; default:
Fix follow warning: [drivers/scsi/qla2xxx/qla_os.c:4882]: (warning) %ld in format string (no. 2) requires 'long' but the argument type is 'unsigned long'. [drivers/scsi/qla2xxx/qla_os.c:5011]: (warning) %ld in format string (no. 1) requires 'long' but the argument type is 'unsigned long'. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> --- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)