mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
crypto: caam - Replace snprintf with strscpy in caam_hash_alloc
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:
committed by
Herbert Xu
parent
a4559a2b37
commit
476466e927
@@ -19,6 +19,7 @@
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/fsl/mc.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/string_choices.h>
|
||||
#include <soc/fsl/dpaa2-io.h>
|
||||
#include <soc/fsl/dpaa2-fd.h>
|
||||
@@ -4644,16 +4645,12 @@ static struct caam_hash_alg *caam_hash_alloc(struct device *dev,
|
||||
alg = &halg->halg.base;
|
||||
|
||||
if (keyed) {
|
||||
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
|
||||
template->hmac_name);
|
||||
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
|
||||
template->hmac_driver_name);
|
||||
strscpy(alg->cra_name, template->hmac_name);
|
||||
strscpy(alg->cra_driver_name, template->hmac_driver_name);
|
||||
t_alg->is_hmac = true;
|
||||
} else {
|
||||
snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s",
|
||||
template->name);
|
||||
snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s",
|
||||
template->driver_name);
|
||||
strscpy(alg->cra_name, template->name);
|
||||
strscpy(alg->cra_driver_name, template->driver_name);
|
||||
t_alg->ahash_alg.setkey = NULL;
|
||||
t_alg->is_hmac = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user