@@ -130,13 +130,6 @@ static void *deflate_alloc_ctx(void)
130
130
return ctx ;
131
131
}
132
132
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
-
140
133
static void __deflate_exit (void * ctx )
141
134
{
142
135
deflate_comp_exit (ctx );
@@ -149,13 +142,6 @@ static void deflate_free_ctx(void *ctx)
149
142
kfree_sensitive (ctx );
150
143
}
151
144
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
-
159
145
static int __deflate_compress (const u8 * src , unsigned int slen ,
160
146
u8 * dst , unsigned int * dlen , void * ctx )
161
147
{
@@ -185,14 +171,6 @@ static int __deflate_compress(const u8 *src, unsigned int slen,
185
171
return ret ;
186
172
}
187
173
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
-
196
174
static int deflate_scompress (struct crypto_scomp * tfm , const u8 * src ,
197
175
unsigned int slen , u8 * dst , unsigned int * dlen ,
198
176
void * ctx )
@@ -241,34 +219,13 @@ static int __deflate_decompress(const u8 *src, unsigned int slen,
241
219
return ret ;
242
220
}
243
221
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
-
252
222
static int deflate_sdecompress (struct crypto_scomp * tfm , const u8 * src ,
253
223
unsigned int slen , u8 * dst , unsigned int * dlen ,
254
224
void * ctx )
255
225
{
256
226
return __deflate_decompress (src , slen , dst , dlen , ctx );
257
227
}
258
228
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
-
272
229
static struct scomp_alg scomp = {
273
230
.alloc_ctx = deflate_alloc_ctx ,
274
231
.free_ctx = deflate_free_ctx ,
@@ -283,24 +240,11 @@ static struct scomp_alg scomp = {
283
240
284
241
static int __init deflate_mod_init (void )
285
242
{
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 );
299
244
}
300
245
301
246
static void __exit deflate_mod_fini (void )
302
247
{
303
- crypto_unregister_alg (& alg );
304
248
crypto_unregister_scomp (& scomp );
305
249
}
306
250
0 commit comments