mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
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 <liulongfang@huawei.com> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
3c6ec632bc
commit
dea300a465
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user