From dea300a465ee8e1821f56fe758ab23ce2f118f75 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Sat, 6 Jun 2026 01:11:01 +0200 Subject: [PATCH] crypto: hisilicon - use 2-arg strscpy where destination size is known To simplify the code, drop explicit and hard-coded size arguments from strscpy() where the destination buffer has a fixed size and strscpy() can automatically determine it using sizeof(). Reviewed-by: Longfang Liu Signed-off-by: Thorsten Blum Signed-off-by: Herbert Xu --- drivers/crypto/hisilicon/qm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c index a951d2ef7833..c01966a4a33f 100644 --- a/drivers/crypto/hisilicon/qm.c +++ b/drivers/crypto/hisilicon/qm.c @@ -2944,11 +2944,8 @@ static int qm_alloc_uacce(struct hisi_qm *qm) .flags = UACCE_DEV_SVA, .ops = &uacce_qm_ops, }; - int ret; - ret = strscpy(interface.name, dev_driver_string(&pdev->dev), - sizeof(interface.name)); - if (ret < 0) + if (strscpy(interface.name, dev_driver_string(&pdev->dev)) < 0) return -ENAMETOOLONG; uacce = uacce_alloc(&pdev->dev, &interface);