Skip to contentSkip to conversation

crypto: essiv - Remove unnecessary strscpy() size argument

PATCH In review Thorsten Blum 2 participants 2 messages Apr 8, 2025 – Apr 16, 2025 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: essiv - Remove unnecessary strscpy() size argument

If the destination buffer has a fixed length, strscpy() automatically determines its size using sizeof() when the argument is omitted. This makes the explicit size argument unnecessary - remove it.

No functional changes intended.

---
 crypto/essiv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
crypto/essiv.c +1 -2
index 1c00c3324058..9d6e72a2d2ae 100644
@@ -549,8 +549,7 @@ static int essiv_create(struct crypto_template *tmpl, struct rtattr **tb)
 	}
 
 	/* record the driver name so we can instantiate this exact algo later */
-	strscpy(ictx->shash_driver_name, hash_alg->base.cra_driver_name,
-		CRYPTO_MAX_ALG_NAME);
+	strscpy(ictx->shash_driver_name, hash_alg->base.cra_driver_name);
 
 	/* Instance fields */
 
maintainer
#1 lore raw
Quoted 10 lines · Thorsten Blum

If the destination buffer has a fixed length, strscpy() automatically determines its size using sizeof() when the argument is omitted. This makes the explicit size argument unnecessary - remove it.

No functional changes intended.

---
 crypto/essiv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt