Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: qce - Replace snprintf("%s") with strscpy

Replace snprintf("%s", ...) with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Thorsten Blum and committed by
Herbert Xu
3193dd7e 39e2a75f

+9 -9
+3 -3
drivers/crypto/qce/aead.c
··· 5 5 */ 6 6 #include <linux/dma-mapping.h> 7 7 #include <linux/interrupt.h> 8 + #include <linux/string.h> 8 9 #include <crypto/gcm.h> 9 10 #include <crypto/authenc.h> 10 11 #include <crypto/internal/aead.h> ··· 769 768 770 769 alg = &tmpl->alg.aead; 771 770 772 - snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); 773 - snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", 774 - def->drv_name); 771 + strscpy(alg->base.cra_name, def->name); 772 + strscpy(alg->base.cra_driver_name, def->drv_name); 775 773 776 774 alg->base.cra_blocksize = def->blocksize; 777 775 alg->chunksize = def->chunksize;
+3 -3
drivers/crypto/qce/sha.c
··· 6 6 #include <linux/device.h> 7 7 #include <linux/dma-mapping.h> 8 8 #include <linux/interrupt.h> 9 + #include <linux/string.h> 9 10 #include <crypto/internal/hash.h> 10 11 11 12 #include "common.h" ··· 490 489 base->cra_module = THIS_MODULE; 491 490 base->cra_init = qce_ahash_cra_init; 492 491 493 - snprintf(base->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); 494 - snprintf(base->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", 495 - def->drv_name); 492 + strscpy(base->cra_name, def->name); 493 + strscpy(base->cra_driver_name, def->drv_name); 496 494 497 495 INIT_LIST_HEAD(&tmpl->entry); 498 496 tmpl->crypto_alg_type = CRYPTO_ALG_TYPE_AHASH;
+3 -3
drivers/crypto/qce/skcipher.c
··· 7 7 #include <linux/dma-mapping.h> 8 8 #include <linux/interrupt.h> 9 9 #include <linux/moduleparam.h> 10 + #include <linux/string.h> 10 11 #include <linux/types.h> 11 12 #include <linux/errno.h> 12 13 #include <crypto/aes.h> ··· 447 446 448 447 alg = &tmpl->alg.skcipher; 449 448 450 - snprintf(alg->base.cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); 451 - snprintf(alg->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", 452 - def->drv_name); 449 + strscpy(alg->base.cra_name, def->name); 450 + strscpy(alg->base.cra_driver_name, def->drv_name); 453 451 454 452 alg->base.cra_blocksize = def->blocksize; 455 453 alg->chunksize = def->chunksize;