]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: cavium/zip - drop obsolete 'comp' implementation
authorArd Biesheuvel <ardb@kernel.org>
Sun, 16 Mar 2025 01:21:22 +0000 (09:21 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Mar 2025 09:39:06 +0000 (17:39 +0800)
The 'comp' API is obsolete and will be removed, so remove this comp
implementation.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/cavium/zip/zip_crypto.c
drivers/crypto/cavium/zip/zip_crypto.h
drivers/crypto/cavium/zip/zip_main.c

index a9c3efce8f2d581a529050ab80aad76af7bacd07..02e87f2d50db523add17a56ef3f0b8d9be71c752 100644 (file)
@@ -195,46 +195,6 @@ static int zip_decompress(const u8 *src, unsigned int slen,
        return ret;
 }
 
-/* Legacy Compress framework start */
-int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm)
-{
-       struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
-
-       return zip_ctx_init(zip_ctx, 0);
-}
-
-int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm)
-{
-       struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
-
-       return zip_ctx_init(zip_ctx, 1);
-}
-
-void zip_free_comp_ctx(struct crypto_tfm *tfm)
-{
-       struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
-
-       zip_ctx_exit(zip_ctx);
-}
-
-int  zip_comp_compress(struct crypto_tfm *tfm,
-                      const u8 *src, unsigned int slen,
-                      u8 *dst, unsigned int *dlen)
-{
-       struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
-
-       return zip_compress(src, slen, dst, dlen, zip_ctx);
-}
-
-int  zip_comp_decompress(struct crypto_tfm *tfm,
-                        const u8 *src, unsigned int slen,
-                        u8 *dst, unsigned int *dlen)
-{
-       struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
-
-       return zip_decompress(src, slen, dst, dlen, zip_ctx);
-} /* Legacy compress framework end */
-
 /* SCOMP framework start */
 void *zip_alloc_scomp_ctx_deflate(void)
 {
index dbe20bfeb3e9acd4628460e49aaac636d9375fba..10899ece2d1f48efa6f4b2ca094743882ec7dd0c 100644 (file)
@@ -46,7 +46,6 @@
 #ifndef __ZIP_CRYPTO_H__
 #define __ZIP_CRYPTO_H__
 
-#include <linux/crypto.h>
 #include <crypto/internal/scompress.h>
 #include "common.h"
 #include "zip_deflate.h"
@@ -57,16 +56,6 @@ struct zip_kernel_ctx {
        struct zip_operation zip_decomp;
 };
 
-int  zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm);
-int  zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm);
-void zip_free_comp_ctx(struct crypto_tfm *tfm);
-int  zip_comp_compress(struct crypto_tfm *tfm,
-                      const u8 *src, unsigned int slen,
-                      u8 *dst, unsigned int *dlen);
-int  zip_comp_decompress(struct crypto_tfm *tfm,
-                        const u8 *src, unsigned int slen,
-                        u8 *dst, unsigned int *dlen);
-
 void *zip_alloc_scomp_ctx_deflate(void);
 void *zip_alloc_scomp_ctx_lzs(void);
 void  zip_free_scomp_ctx(void *zip_ctx);
index dc5b7bf7e1fd98670e144b3b7634ea1d63963d7a..abd58de4343ddd8ecafff892fe586ddb992c8de5 100644 (file)
@@ -371,36 +371,6 @@ static struct pci_driver zip_driver = {
 
 /* Kernel Crypto Subsystem Interface */
 
-static struct crypto_alg zip_comp_deflate = {
-       .cra_name               = "deflate",
-       .cra_driver_name        = "deflate-cavium",
-       .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
-       .cra_ctxsize            = sizeof(struct zip_kernel_ctx),
-       .cra_priority           = 300,
-       .cra_module             = THIS_MODULE,
-       .cra_init               = zip_alloc_comp_ctx_deflate,
-       .cra_exit               = zip_free_comp_ctx,
-       .cra_u                  = { .compress = {
-               .coa_compress   = zip_comp_compress,
-               .coa_decompress = zip_comp_decompress
-                } }
-};
-
-static struct crypto_alg zip_comp_lzs = {
-       .cra_name               = "lzs",
-       .cra_driver_name        = "lzs-cavium",
-       .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
-       .cra_ctxsize            = sizeof(struct zip_kernel_ctx),
-       .cra_priority           = 300,
-       .cra_module             = THIS_MODULE,
-       .cra_init               = zip_alloc_comp_ctx_lzs,
-       .cra_exit               = zip_free_comp_ctx,
-       .cra_u                  = { .compress = {
-               .coa_compress   = zip_comp_compress,
-               .coa_decompress = zip_comp_decompress
-                } }
-};
-
 static struct scomp_alg zip_scomp_deflate = {
        .alloc_ctx              = zip_alloc_scomp_ctx_deflate,
        .free_ctx               = zip_free_scomp_ctx,
@@ -431,22 +401,10 @@ static int zip_register_compression_device(void)
 {
        int ret;
 
-       ret = crypto_register_alg(&zip_comp_deflate);
-       if (ret < 0) {
-               zip_err("Deflate algorithm registration failed\n");
-               return ret;
-       }
-
-       ret = crypto_register_alg(&zip_comp_lzs);
-       if (ret < 0) {
-               zip_err("LZS algorithm registration failed\n");
-               goto err_unregister_alg_deflate;
-       }
-
        ret = crypto_register_scomp(&zip_scomp_deflate);
        if (ret < 0) {
                zip_err("Deflate scomp algorithm registration failed\n");
-               goto err_unregister_alg_lzs;
+               return ret;
        }
 
        ret = crypto_register_scomp(&zip_scomp_lzs);
@@ -459,18 +417,12 @@ static int zip_register_compression_device(void)
 
 err_unregister_scomp_deflate:
        crypto_unregister_scomp(&zip_scomp_deflate);
-err_unregister_alg_lzs:
-       crypto_unregister_alg(&zip_comp_lzs);
-err_unregister_alg_deflate:
-       crypto_unregister_alg(&zip_comp_deflate);
 
        return ret;
 }
 
 static void zip_unregister_compression_device(void)
 {
-       crypto_unregister_alg(&zip_comp_deflate);
-       crypto_unregister_alg(&zip_comp_lzs);
        crypto_unregister_scomp(&zip_scomp_deflate);
        crypto_unregister_scomp(&zip_scomp_lzs);
 }