From bd067766ee2aeb35589ad74d599b0e6311f68c73 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Fri, 14 Mar 2025 23:16:26 +0100 Subject: [PATCH] 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 Link: https://lore.kernel.org/r/20250314221626.43174-2-thorsten.blum@linux.dev Reviewed-by: Karan Tilak Kumar Signed-off-by: Martin K. Petersen --- drivers/scsi/fnic/fdls_disc.c | 3 --- 1 file changed, 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); -- 2.50.1