From d1dd206c2abf678889445e63ecc949e9274f5806 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Mon, 9 Dec 2013 20:08:19 +0800 Subject: 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 Signed-off-by: Fengguang Wu Signed-off-by: Herbert Xu --- drivers/crypto/ccp/ccp-crypto-aes.c | 2 +- drivers/crypto/ccp/ccp-crypto-sha.c | 2 +- drivers/crypto/ccp/ccp-dev.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/crypto/ccp') 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, /* Copy the defaults and override as necessary */ alg = &ccp_alg->alg; - memcpy(alg, def->alg_defaults, sizeof(*alg)); + *alg = *def->alg_defaults; snprintf(alg->cra_name, CRYPTO_MAX_ALG_NAME, "%s", def->name); snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", 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, return -ENOMEM; /* Copy the base algorithm and only change what's necessary */ - memcpy(ccp_alg, base_alg, sizeof(*ccp_alg)); + *ccp_alg = *base_alg; INIT_LIST_HEAD(&ccp_alg->entry); 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) return -ENODEV; return ccp_pci_init(); break; - }; + } return -ENODEV; } @@ -575,7 +575,7 @@ static void __exit ccp_mod_exit(void) case 22: ccp_pci_exit(); break; - }; + } } module_init(ccp_mod_init); -- cgit v1.2.3