From: Thorsten Blum Date: Fri, 14 Mar 2025 22:16:26 +0000 (+0100) Subject: scsi: fnic: Remove unnecessary NUL-terminations X-Git-Tag: v6.15-rc1~164^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd067766ee2aeb35589ad74d599b0e6311f68c73;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/drivers/scsi/fnic/fdls_disc.c b/drivers/scsi/fnic/fdls_disc.c index a9ffa7b637306..4c6bbf417a9aa 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);