crypto: qce - Replace snprintf("%s") with strscpy
Subsystems (3)
PATCH 1/1 crypto: qce - Replace snprintf("%s") with strscpy
Replace snprintf("%s", ...) with the faster and more direct strscpy().
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/crypto/qce/aead.c | 6 +++--- drivers/crypto/qce/sha.c | 6 +++--- drivers/crypto/qce/skcipher.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-)
drivers/crypto/qce/aead.c +3 -3
@@ -5,6 +5,7 @@*/ #include <linux/dma-mapping.h> #include <linux/interrupt.h> +#include <linux/string.h> #include <crypto/gcm.h> #include <crypto/authenc.h> #include <crypto/internal/aead.h>
@@ -768,9 +769,8 @@ static int qce_aead_register_one(const struct qce_aead_def *def, struct qce_devi alg = &tmpl->alg.aead; -snprintf (alg->base.cra_name,CRYPTO_MAX_ALG_NAME ,"%s" , def->name); -snprintf (alg->base.cra_driver_name,CRYPTO_MAX_ALG_NAME ,"%s" , - def->drv_name); +strscpy (alg->base.cra_name, def->name); +strscpy (alg->base.cra_driver_name, def->drv_name); alg->base.cra_blocksize = def->blocksize; alg->chunksize = def->chunksize;
drivers/crypto/qce/sha.c +3 -3
@@ -6,6 +6,7 @@#include <linux/device.h> #include <linux/dma-mapping.h> #include <linux/interrupt.h> +#include <linux/string.h> #include <crypto/internal/hash.h> #include "common.h"
@@ -489,9 +490,8 @@ static int qce_ahash_register_one(const struct qce_ahash_def *def, base->cra_module =THIS_MODULE ; base->cra_init = qce_ahash_cra_init; -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);INIT_LIST_HEAD (&tmpl->entry); tmpl->crypto_alg_type =CRYPTO_ALG_TYPE_AHASH ;
drivers/crypto/qce/skcipher.c +3 -3
@@ -7,6 +7,7 @@#include <linux/dma-mapping.h> #include <linux/interrupt.h> #include <linux/moduleparam.h> +#include <linux/string.h> #include <linux/types.h> #include <linux/errno.h> #include <crypto/aes.h>
@@ -446,9 +447,8 @@ static int qce_skcipher_register_one(const struct qce_skcipher_def *def, alg = &tmpl->alg.skcipher; -snprintf (alg->base.cra_name,CRYPTO_MAX_ALG_NAME ,"%s" , def->name); -snprintf (alg->base.cra_driver_name,CRYPTO_MAX_ALG_NAME ,"%s" , - def->drv_name); +strscpy (alg->base.cra_name, def->name); +strscpy (alg->base.cra_driver_name, def->drv_name); alg->base.cra_blocksize = def->blocksize; alg->chunksize = def->chunksize;
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Quoted 4 lines · Thorsten Blum
Replace
snprintf("%s", ...)with the faster and more directstrscpy().Signed-off-by Thorsten Blum <[email protected]>---
Reviewed-by Konrad Dybcio <[email protected]>
Konrad
Herbert Xu
maintainerQuoted 8 lines · Thorsten Blum
Replace
snprintf("%s", ...)with the faster and more directstrscpy().Signed-off-by Thorsten Blum <[email protected]>--- drivers/crypto/qce/aead.c | 6 +++--- drivers/crypto/qce/sha.c | 6 +++--- drivers/crypto/qce/skcipher.c | 6 +++--- 3 files changed, 9 insertions(+), 9 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