crypto: ccp - Replace snprintf("%s") with strscpy

Replace snprintf("%s") with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Thorsten Blum
2026-03-24 12:30:07 +01:00
committed by Herbert Xu
parent d7f3162ff8
commit ee31b703e8
6 changed files with 15 additions and 18 deletions

View File

@@ -484,9 +484,8 @@ static int ccp_register_sha_alg(struct list_head *head,
halg->statesize = sizeof(struct ccp_sha_exp_ctx);
base = &halg->base;
snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name);
snprintf(base->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
def->drv_name);
strscpy(base->cra_name, def->name);
strscpy(base->cra_driver_name, def->drv_name);
base->cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_ALLOCATES_MEMORY |
CRYPTO_ALG_KERN_DRIVER_ONLY |