[CRYPTO] all: Pass tfm instead of ctx to algorithms
[linux-block.git] / crypto / deflate.c
index f209368d62aefab5c1c1998f2af20159d5323d6b..5dd2404ae5b2d710d797997f5df7c59cfb4cf985 100644 (file)
@@ -102,8 +102,9 @@ static void deflate_decomp_exit(struct deflate_ctx *ctx)
        kfree(ctx->decomp_stream.workspace);
 }
 
-static int deflate_init(void *ctx)
+static int deflate_init(struct crypto_tfm *tfm)
 {
+       struct deflate_ctx *ctx = crypto_tfm_ctx(tfm);
        int ret;
        
        ret = deflate_comp_init(ctx);
@@ -116,17 +117,19 @@ out:
        return ret;
 }
 
-static void deflate_exit(void *ctx)
+static void deflate_exit(struct crypto_tfm *tfm)
 {
+       struct deflate_ctx *ctx = crypto_tfm_ctx(tfm);
+
        deflate_comp_exit(ctx);
        deflate_decomp_exit(ctx);
 }
 
-static int deflate_compress(void *ctx, const u8 *src, unsigned int slen,
-                           u8 *dst, unsigned int *dlen)
+static int deflate_compress(struct crypto_tfm *tfm, const u8 *src,
+                           unsigned int slen, u8 *dst, unsigned int *dlen)
 {
        int ret = 0;
-       struct deflate_ctx *dctx = ctx;
+       struct deflate_ctx *dctx = crypto_tfm_ctx(tfm);
        struct z_stream_s *stream = &dctx->comp_stream;
 
        ret = zlib_deflateReset(stream);
@@ -151,12 +154,12 @@ out:
        return ret;
 }
  
-static int deflate_decompress(void *ctx, const u8 *src, unsigned int slen,
-                              u8 *dst, unsigned int *dlen)
+static int deflate_decompress(struct crypto_tfm *tfm, const u8 *src,
+                             unsigned int slen, u8 *dst, unsigned int *dlen)
 {
        
        int ret = 0;
-       struct deflate_ctx *dctx = ctx;
+       struct deflate_ctx *dctx = crypto_tfm_ctx(tfm);
        struct z_stream_s *stream = &dctx->decomp_stream;
 
        ret = zlib_inflateReset(stream);