Skip to content

Commit bd06776

Browse files
tobluxmartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Karan Tilak Kumar <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 160d6ec commit bd06776

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/scsi/fnic/fdls_disc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,6 @@ static void fdls_fdmi_register_hba(struct fnic_iport_s *iport)
18841884
if (fnic->subsys_desc_len >= FNIC_FDMI_MODEL_LEN)
18851885
fnic->subsys_desc_len = FNIC_FDMI_MODEL_LEN - 1;
18861886
strscpy_pad(data, fnic->subsys_desc, FNIC_FDMI_MODEL_LEN);
1887-
data[FNIC_FDMI_MODEL_LEN - 1] = 0;
18881887
fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_MODEL, FNIC_FDMI_MODEL_LEN,
18891888
data, &attr_off_bytes);
18901889

@@ -2047,7 +2046,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport)
20472046
snprintf(tmp_data, FNIC_FDMI_OS_NAME_LEN - 1, "host%d",
20482047
fnic->host->host_no);
20492048
strscpy_pad(data, tmp_data, FNIC_FDMI_OS_NAME_LEN);
2050-
data[FNIC_FDMI_OS_NAME_LEN - 1] = 0;
20512049
fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_OS_NAME,
20522050
FNIC_FDMI_OS_NAME_LEN, data, &attr_off_bytes);
20532051

@@ -2057,7 +2055,6 @@ static void fdls_fdmi_register_pa(struct fnic_iport_s *iport)
20572055
sprintf(fc_host_system_hostname(fnic->host), "%s", utsname()->nodename);
20582056
strscpy_pad(data, fc_host_system_hostname(fnic->host),
20592057
FNIC_FDMI_HN_LEN);
2060-
data[FNIC_FDMI_HN_LEN - 1] = 0;
20612058
fnic_fdmi_attr_set(fdmi_attr, FNIC_FDMI_TYPE_HOST_NAME,
20622059
FNIC_FDMI_HN_LEN, data, &attr_off_bytes);
20632060

0 commit comments

Comments
 (0)