scsi: mpt3sas: Replace deprecated strncpy() with strscpy()
authorJustin Stitt <justinstitt@google.com>
Tue, 5 Mar 2024 23:34:37 +0000 (23:34 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 10 Mar 2024 22:37:43 +0000 (18:37 -0400)
commitb7e9712a02e869d2c15a3a2284b078771fd484d7
treefcb530cce53f2e74b526894f26c86ce14918b352
parent8c8e2422bde198efa57566d768400f73cc485aad
scsi: mpt3sas: Replace deprecated strncpy() with strscpy()

The replacement in mpt3sas_base.c is a trivial one because desc is already
zero-initialized meaning there is no functional change here.

For mpt3sas_transport.c, we know edev is zero-initialized as well while
manufacture_reply comes from dma_alloc_coherent(). No functional change
here either.

For all cases, use the more idiomatic strscpy() usage of: strscpy(dest,
src, sizeof(dest))

Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20240305-strncpy-drivers-scsi-mpi3mr-mpi3mr_fw-c-v3-2-5b78a13ff984@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/mpt3sas/mpt3sas_transport.c