From: Wolfram Sang Date: Thu, 18 Aug 2022 20:59:59 +0000 (+0200) Subject: char: move from strlcpy with unused retval to strscpy X-Git-Tag: v6.6.17~6414^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e174b1273ef97d090ef85cb09a6bfdc10ea8dcf6;p=platform%2Fkernel%2Flinux-rpi.git char: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Link: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Wolfram Sang Signed-off-by: Jarkko Sakkinen --- diff --git a/drivers/char/tpm/tpm_ppi.c b/drivers/char/tpm/tpm_ppi.c index 40018a7..bc7b1b4 100644 --- a/drivers/char/tpm/tpm_ppi.c +++ b/drivers/char/tpm/tpm_ppi.c @@ -380,7 +380,7 @@ void tpm_add_ppi(struct tpm_chip *chip) TPM_PPI_FN_VERSION, NULL, ACPI_TYPE_STRING); if (obj) { - strlcpy(chip->ppi_version, obj->string.pointer, + strscpy(chip->ppi_version, obj->string.pointer, sizeof(chip->ppi_version)); ACPI_FREE(obj); }