@@ -130,13 +130,6 @@ static void *deflate_alloc_ctx(void)
130130 return ctx ;
131131}
132132
133- static int deflate_init (struct crypto_tfm * tfm )
134- {
135- struct deflate_ctx * ctx = crypto_tfm_ctx (tfm );
136-
137- return __deflate_init (ctx );
138- }
139-
140133static void __deflate_exit (void * ctx )
141134{
142135 deflate_comp_exit (ctx );
@@ -149,13 +142,6 @@ static void deflate_free_ctx(void *ctx)
149142 kfree_sensitive (ctx );
150143}
151144
152- static void deflate_exit (struct crypto_tfm * tfm )
153- {
154- struct deflate_ctx * ctx = crypto_tfm_ctx (tfm );
155-
156- __deflate_exit (ctx );
157- }
158-
159145static int __deflate_compress (const u8 * src , unsigned int slen ,
160146 u8 * dst , unsigned int * dlen , void * ctx )
161147{
@@ -185,14 +171,6 @@ static int __deflate_compress(const u8 *src, unsigned int slen,
185171 return ret ;
186172}
187173
188- static int deflate_compress (struct crypto_tfm * tfm , const u8 * src ,
189- unsigned int slen , u8 * dst , unsigned int * dlen )
190- {
191- struct deflate_ctx * dctx = crypto_tfm_ctx (tfm );
192-
193- return __deflate_compress (src , slen , dst , dlen , dctx );
194- }
195-
196174static int deflate_scompress (struct crypto_scomp * tfm , const u8 * src ,
197175 unsigned int slen , u8 * dst , unsigned int * dlen ,
198176 void * ctx )
@@ -241,34 +219,13 @@ static int __deflate_decompress(const u8 *src, unsigned int slen,
241219 return ret ;
242220}
243221
244- static int deflate_decompress (struct crypto_tfm * tfm , const u8 * src ,
245- unsigned int slen , u8 * dst , unsigned int * dlen )
246- {
247- struct deflate_ctx * dctx = crypto_tfm_ctx (tfm );
248-
249- return __deflate_decompress (src , slen , dst , dlen , dctx );
250- }
251-
252222static int deflate_sdecompress (struct crypto_scomp * tfm , const u8 * src ,
253223 unsigned int slen , u8 * dst , unsigned int * dlen ,
254224 void * ctx )
255225{
256226 return __deflate_decompress (src , slen , dst , dlen , ctx );
257227}
258228
259- static struct crypto_alg alg = {
260- .cra_name = "deflate" ,
261- .cra_driver_name = "deflate-generic" ,
262- .cra_flags = CRYPTO_ALG_TYPE_COMPRESS ,
263- .cra_ctxsize = sizeof (struct deflate_ctx ),
264- .cra_module = THIS_MODULE ,
265- .cra_init = deflate_init ,
266- .cra_exit = deflate_exit ,
267- .cra_u = { .compress = {
268- .coa_compress = deflate_compress ,
269- .coa_decompress = deflate_decompress } }
270- };
271-
272229static struct scomp_alg scomp = {
273230 .alloc_ctx = deflate_alloc_ctx ,
274231 .free_ctx = deflate_free_ctx ,
@@ -283,24 +240,11 @@ static struct scomp_alg scomp = {
283240
284241static int __init deflate_mod_init (void )
285242{
286- int ret ;
287-
288- ret = crypto_register_alg (& alg );
289- if (ret )
290- return ret ;
291-
292- ret = crypto_register_scomp (& scomp );
293- if (ret ) {
294- crypto_unregister_alg (& alg );
295- return ret ;
296- }
297-
298- return ret ;
243+ return crypto_register_scomp (& scomp );
299244}
300245
301246static void __exit deflate_mod_fini (void )
302247{
303- crypto_unregister_alg (& alg );
304248 crypto_unregister_scomp (& scomp );
305249}
306250
0 commit comments