diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-03-14 23:16:26 +0100 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2025-03-17 22:04:21 -0400 |
| commit | bd067766ee2aeb35589ad74d599b0e6311f68c73 (patch) | |
| tree | 03dd44181d5af649daaaf7ccd0cad45599527d36 | |
| parent | 160d6ec69f401037a9a00b9b6569082e4d0649b0 (diff) | |
scsi: fnic: Remove unnecessary NUL-terminations
strscpy_pad() already NUL-terminates 'data' at the corresponding
indexes. Remove any unnecessary NUL-terminations.
No functional changes intended.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://lore.kernel.org/r/20250314221626.43174-2-thorsten.blum@linux.dev
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
| -rw-r--r-- | drivers/scsi/fnic/fdls_disc.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c index a9ffa7b63730..4c6bbf417a9a 100644 --- a/drivers/scsi/fnic/fdls_disc.c +++ b/drivers/scsi/fnic/fdls_disc.c @@ -1884,7 +1884,6 @@ static void fdls_fdmi_register_hba(struct fnic_iport_s *iport) if (fnic->subsys_desc_len >= FNIC_FDMI_MODEL_LEN) fnic->subsys_desc_len = FNIC_FDMI_MODEL_LEN - 1; strscpy_pad(data, fnic->subsys_desc, FNIC_FDMI_MODEL_LEN); - data[FNIC_FDMI_MODEL_LEN - 1] = 0; fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_MODEL, FNIC_FDMI_MODEL_LEN, data, &attr_off_bytes); @@ -2047,7 +2046,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport) snprintf(tmp_data, FNIC_FDMI_OS_NAME_LEN - 1, "host%d", fnic->host->host_no); strscpy_pad(data, tmp_data, FNIC_FDMI_OS_NAME_LEN); - data[FNIC_FDMI_OS_NAME_LEN - 1] = 0; fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_OS_NAME, FNIC_FDMI_OS_NAME_LEN, data, &attr_off_bytes); @@ -2057,7 +2055,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport) sprintf(fc_host_system_hostname(fnic->host), "%s", utsname()->nodename); strscpy_pad(data, fc_host_system_hostname(fnic->host), FNIC_FDMI_HN_LEN); - data[FNIC_FDMI_HN_LEN - 1] = 0; fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_HOST_NAME, FNIC_FDMI_HN_LEN, data, &attr_off_bytes); |
