diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2013-12-09 07:08:19 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-12-09 07:08:19 -0500 |
commit | d1dd206c2abf678889445e63ecc949e9274f5806 (patch) | |
tree | f4e13b84d6acfaa6b9a859ce8922249c653aadd0 /drivers/crypto | |
parent | f7b2b5dd6a62a47e871627c71ed01aa3482154d9 (diff) |
crytpo: ccp - fix coccinelle warnings
drivers/crypto/ccp/ccp-crypto-aes.c:344:1-7: Replace memcpy with struct assignment
drivers/crypto/ccp/ccp-crypto-sha.c:398:1-7: Replace memcpy with struct assignment
drivers/crypto/ccp/ccp-dev.c:578:2-3: Unneeded semicolon
/c/kernel-tests/src/cocci/drivers/crypto/ccp/ccp-dev.c:565:2-3: Unneeded semicolon
Generated by: coccinelle/misc/memcpy-assign.cocci
CC: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-aes.c | 2 | ||||
-rw-r--r-- | drivers/crypto/ccp/ccp-crypto-sha.c | 2 | ||||
-rw-r--r-- | drivers/crypto/ccp/ccp-dev.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-aes.c b/drivers/crypto/ccp/ccp-crypto-aes.c index f302a5b7473b..c0befdb2240b 100644 --- a/drivers/crypto/ccp/ccp-crypto-aes.c +++ b/drivers/crypto/ccp/ccp-crypto-aes.c | |||
@@ -341,7 +341,7 @@ static int ccp_register_aes_alg(struct list_head *head, | |||
341 | 341 | ||
342 | /* Copy the defaults and override as necessary */ | 342 | /* Copy the defaults and override as necessary */ |
343 | alg = &ccp_alg->alg; | 343 | alg = &ccp_alg->alg; |
344 | memcpy(alg, def->alg_defaults, sizeof(*alg)); | 344 | *alg = *def->alg_defaults; |
345 | snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); | 345 | snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); |
346 | snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", | 346 | snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", |
347 | def->driver_name); | 347 | def->driver_name); |
diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c index 44ff00a09c8a..a6ef183f0afc 100644 --- a/drivers/crypto/ccp/ccp-crypto-sha.c +++ b/drivers/crypto/ccp/ccp-crypto-sha.c | |||
@@ -395,7 +395,7 @@ static int ccp_register_hmac_alg(struct list_head *head, | |||
395 | return -ENOMEM; | 395 | return -ENOMEM; |
396 | 396 | ||
397 | /* Copy the base algorithm and only change what's necessary */ | 397 | /* Copy the base algorithm and only change what's necessary */ |
398 | memcpy(ccp_alg, base_alg, sizeof(*ccp_alg)); | 398 | *ccp_alg = *base_alg; |
399 | INIT_LIST_HEAD(&ccp_alg->entry); | 399 | INIT_LIST_HEAD(&ccp_alg->entry); |
400 | 400 | ||
401 | strncpy(ccp_alg->child_alg, def->name, CRYPTO_MAX_ALG_NAME); | 401 | strncpy(ccp_alg->child_alg, def->name, CRYPTO_MAX_ALG_NAME); |
diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c index de59df970176..b2038a7e91e1 100644 --- a/drivers/crypto/ccp/ccp-dev.c +++ b/drivers/crypto/ccp/ccp-dev.c | |||
@@ -562,7 +562,7 @@ static int __init ccp_mod_init(void) | |||
562 | return -ENODEV; | 562 | return -ENODEV; |
563 | return ccp_pci_init(); | 563 | return ccp_pci_init(); |
564 | break; | 564 | break; |
565 | }; | 565 | } |
566 | 566 | ||
567 | return -ENODEV; | 567 | return -ENODEV; |
568 | } | 568 | } |
@@ -575,7 +575,7 @@ static void __exit ccp_mod_exit(void) | |||
575 | case 22: | 575 | case 22: |
576 | ccp_pci_exit(); | 576 | ccp_pci_exit(); |
577 | break; | 577 | break; |
578 | }; | 578 | } |
579 | } | 579 | } |
580 | 580 | ||
581 | module_init(ccp_mod_init); | 581 | module_init(ccp_mod_init); |