Skip to content

Commit bd40bf1

Browse files
ardbiesheuvelherbertx
authored andcommitted
crypto: cavium/zip - drop obsolete 'comp' implementation
The 'comp' API is obsolete and will be removed, so remove this comp implementation. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 8beb404 commit bd40bf1

File tree

3 files changed

+1
-100
lines changed

3 files changed

+1
-100
lines changed

drivers/crypto/cavium/zip/zip_crypto.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -195,46 +195,6 @@ static int zip_decompress(const u8 *src, unsigned int slen,
195195
return ret;
196196
}
197197

198-
/* Legacy Compress framework start */
199-
int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm)
200-
{
201-
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
202-
203-
return zip_ctx_init(zip_ctx, 0);
204-
}
205-
206-
int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm)
207-
{
208-
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
209-
210-
return zip_ctx_init(zip_ctx, 1);
211-
}
212-
213-
void zip_free_comp_ctx(struct crypto_tfm *tfm)
214-
{
215-
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
216-
217-
zip_ctx_exit(zip_ctx);
218-
}
219-
220-
int zip_comp_compress(struct crypto_tfm *tfm,
221-
const u8 *src, unsigned int slen,
222-
u8 *dst, unsigned int *dlen)
223-
{
224-
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
225-
226-
return zip_compress(src, slen, dst, dlen, zip_ctx);
227-
}
228-
229-
int zip_comp_decompress(struct crypto_tfm *tfm,
230-
const u8 *src, unsigned int slen,
231-
u8 *dst, unsigned int *dlen)
232-
{
233-
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
234-
235-
return zip_decompress(src, slen, dst, dlen, zip_ctx);
236-
} /* Legacy compress framework end */
237-
238198
/* SCOMP framework start */
239199
void *zip_alloc_scomp_ctx_deflate(void)
240200
{

drivers/crypto/cavium/zip/zip_crypto.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#ifndef __ZIP_CRYPTO_H__
4747
#define __ZIP_CRYPTO_H__
4848

49-
#include <linux/crypto.h>
5049
#include <crypto/internal/scompress.h>
5150
#include "common.h"
5251
#include "zip_deflate.h"
@@ -57,16 +56,6 @@ struct zip_kernel_ctx {
5756
struct zip_operation zip_decomp;
5857
};
5958

60-
int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm);
61-
int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm);
62-
void zip_free_comp_ctx(struct crypto_tfm *tfm);
63-
int zip_comp_compress(struct crypto_tfm *tfm,
64-
const u8 *src, unsigned int slen,
65-
u8 *dst, unsigned int *dlen);
66-
int zip_comp_decompress(struct crypto_tfm *tfm,
67-
const u8 *src, unsigned int slen,
68-
u8 *dst, unsigned int *dlen);
69-
7059
void *zip_alloc_scomp_ctx_deflate(void);
7160
void *zip_alloc_scomp_ctx_lzs(void);
7261
void zip_free_scomp_ctx(void *zip_ctx);

drivers/crypto/cavium/zip/zip_main.c

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -371,36 +371,6 @@ static struct pci_driver zip_driver = {
371371

372372
/* Kernel Crypto Subsystem Interface */
373373

374-
static struct crypto_alg zip_comp_deflate = {
375-
.cra_name = "deflate",
376-
.cra_driver_name = "deflate-cavium",
377-
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
378-
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
379-
.cra_priority = 300,
380-
.cra_module = THIS_MODULE,
381-
.cra_init = zip_alloc_comp_ctx_deflate,
382-
.cra_exit = zip_free_comp_ctx,
383-
.cra_u = { .compress = {
384-
.coa_compress = zip_comp_compress,
385-
.coa_decompress = zip_comp_decompress
386-
} }
387-
};
388-
389-
static struct crypto_alg zip_comp_lzs = {
390-
.cra_name = "lzs",
391-
.cra_driver_name = "lzs-cavium",
392-
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
393-
.cra_ctxsize = sizeof(struct zip_kernel_ctx),
394-
.cra_priority = 300,
395-
.cra_module = THIS_MODULE,
396-
.cra_init = zip_alloc_comp_ctx_lzs,
397-
.cra_exit = zip_free_comp_ctx,
398-
.cra_u = { .compress = {
399-
.coa_compress = zip_comp_compress,
400-
.coa_decompress = zip_comp_decompress
401-
} }
402-
};
403-
404374
static struct scomp_alg zip_scomp_deflate = {
405375
.alloc_ctx = zip_alloc_scomp_ctx_deflate,
406376
.free_ctx = zip_free_scomp_ctx,
@@ -431,22 +401,10 @@ static int zip_register_compression_device(void)
431401
{
432402
int ret;
433403

434-
ret = crypto_register_alg(&zip_comp_deflate);
435-
if (ret < 0) {
436-
zip_err("Deflate algorithm registration failed\n");
437-
return ret;
438-
}
439-
440-
ret = crypto_register_alg(&zip_comp_lzs);
441-
if (ret < 0) {
442-
zip_err("LZS algorithm registration failed\n");
443-
goto err_unregister_alg_deflate;
444-
}
445-
446404
ret = crypto_register_scomp(&zip_scomp_deflate);
447405
if (ret < 0) {
448406
zip_err("Deflate scomp algorithm registration failed\n");
449-
goto err_unregister_alg_lzs;
407+
return ret;
450408
}
451409

452410
ret = crypto_register_scomp(&zip_scomp_lzs);
@@ -459,18 +417,12 @@ static int zip_register_compression_device(void)
459417

460418
err_unregister_scomp_deflate:
461419
crypto_unregister_scomp(&zip_scomp_deflate);
462-
err_unregister_alg_lzs:
463-
crypto_unregister_alg(&zip_comp_lzs);
464-
err_unregister_alg_deflate:
465-
crypto_unregister_alg(&zip_comp_deflate);
466420

467421
return ret;
468422
}
469423

470424
static void zip_unregister_compression_device(void)
471425
{
472-
crypto_unregister_alg(&zip_comp_deflate);
473-
crypto_unregister_alg(&zip_comp_lzs);
474426
crypto_unregister_scomp(&zip_scomp_deflate);
475427
crypto_unregister_scomp(&zip_scomp_lzs);
476428
}

0 commit comments

Comments
 (0)