aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/crypto/ablk_helper.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>2012-06-18 07:07:08 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2012-06-27 02:42:01 -0400
commita9629d7142ea22567eaa999232d8a31a7493665a (patch)
tree6693434c4fa675478f7c3bca469f29b22670f713 /arch/x86/crypto/ablk_helper.c
parent30a04008827b58c4aafbd1d6a27d6b6ed239e993 (diff)
crypto: aes_ni - change to use shared ablk_* functions
Remove duplicate ablk_* functions and make use of ablk_helper module instead. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/x86/crypto/ablk_helper.c')
-rw-r--r--arch/x86/crypto/ablk_helper.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/x86/crypto/ablk_helper.c b/arch/x86/crypto/ablk_helper.c
index 284ca3bc2383..43282fe04a8b 100644
--- a/arch/x86/crypto/ablk_helper.c
+++ b/arch/x86/crypto/ablk_helper.c
@@ -118,32 +118,31 @@ void ablk_exit(struct crypto_tfm *tfm)
118} 118}
119EXPORT_SYMBOL_GPL(ablk_exit); 119EXPORT_SYMBOL_GPL(ablk_exit);
120 120
121void ablk_init_common(struct crypto_tfm *tfm, 121int ablk_init_common(struct crypto_tfm *tfm, const char *drv_name)
122 struct cryptd_ablkcipher *cryptd_tfm)
123{ 122{
124 struct async_helper_ctx *ctx = crypto_tfm_ctx(tfm); 123 struct async_helper_ctx *ctx = crypto_tfm_ctx(tfm);
124 struct cryptd_ablkcipher *cryptd_tfm;
125
126 cryptd_tfm = cryptd_alloc_ablkcipher(drv_name, 0, 0);
127 if (IS_ERR(cryptd_tfm))
128 return PTR_ERR(cryptd_tfm);
125 129
126 ctx->cryptd_tfm = cryptd_tfm; 130 ctx->cryptd_tfm = cryptd_tfm;
127 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request) + 131 tfm->crt_ablkcipher.reqsize = sizeof(struct ablkcipher_request) +
128 crypto_ablkcipher_reqsize(&cryptd_tfm->base); 132 crypto_ablkcipher_reqsize(&cryptd_tfm->base);
133
134 return 0;
129} 135}
130EXPORT_SYMBOL_GPL(ablk_init_common); 136EXPORT_SYMBOL_GPL(ablk_init_common);
131 137
132int ablk_init(struct crypto_tfm *tfm) 138int ablk_init(struct crypto_tfm *tfm)
133{ 139{
134 struct cryptd_ablkcipher *cryptd_tfm;
135 char drv_name[CRYPTO_MAX_ALG_NAME]; 140 char drv_name[CRYPTO_MAX_ALG_NAME];
136 141
137 snprintf(drv_name, sizeof(drv_name), "__driver-%s", 142 snprintf(drv_name, sizeof(drv_name), "__driver-%s",
138 crypto_tfm_alg_driver_name(tfm)); 143 crypto_tfm_alg_driver_name(tfm));
139 144
140 cryptd_tfm = cryptd_alloc_ablkcipher(drv_name, 0, 0); 145 return ablk_init_common(tfm, drv_name);
141 if (IS_ERR(cryptd_tfm))
142 return PTR_ERR(cryptd_tfm);
143
144 ablk_init_common(tfm, cryptd_tfm);
145
146 return 0;
147} 146}
148EXPORT_SYMBOL_GPL(ablk_init); 147EXPORT_SYMBOL_GPL(ablk_init);
149 148