Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: scomp - Remove tfm argument from alloc/free_ctx

The tfm argument is completely unused and meaningless as the
same stream object is identical over all transforms of a given
algorithm. Remove it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

+34 -34
+4 -4
crypto/842.c
··· 28 28 void *wmem; /* working memory for compress */ 29 29 }; 30 30 31 - static void *crypto842_alloc_ctx(struct crypto_scomp *tfm) 31 + static void *crypto842_alloc_ctx(void) 32 32 { 33 33 void *ctx; 34 34 ··· 43 43 { 44 44 struct crypto842_ctx *ctx = crypto_tfm_ctx(tfm); 45 45 46 - ctx->wmem = crypto842_alloc_ctx(NULL); 46 + ctx->wmem = crypto842_alloc_ctx(); 47 47 if (IS_ERR(ctx->wmem)) 48 48 return -ENOMEM; 49 49 50 50 return 0; 51 51 } 52 52 53 - static void crypto842_free_ctx(struct crypto_scomp *tfm, void *ctx) 53 + static void crypto842_free_ctx(void *ctx) 54 54 { 55 55 kfree(ctx); 56 56 } ··· 59 59 { 60 60 struct crypto842_ctx *ctx = crypto_tfm_ctx(tfm); 61 61 62 - crypto842_free_ctx(NULL, ctx->wmem); 62 + crypto842_free_ctx(ctx->wmem); 63 63 } 64 64 65 65 static int crypto842_compress(struct crypto_tfm *tfm,
+2 -2
crypto/deflate.c
··· 112 112 return ret; 113 113 } 114 114 115 - static void *deflate_alloc_ctx(struct crypto_scomp *tfm) 115 + static void *deflate_alloc_ctx(void) 116 116 { 117 117 struct deflate_ctx *ctx; 118 118 int ret; ··· 143 143 deflate_decomp_exit(ctx); 144 144 } 145 145 146 - static void deflate_free_ctx(struct crypto_scomp *tfm, void *ctx) 146 + static void deflate_free_ctx(void *ctx) 147 147 { 148 148 __deflate_exit(ctx); 149 149 kfree_sensitive(ctx);
+4 -4
crypto/lz4.c
··· 16 16 void *lz4_comp_mem; 17 17 }; 18 18 19 - static void *lz4_alloc_ctx(struct crypto_scomp *tfm) 19 + static void *lz4_alloc_ctx(void) 20 20 { 21 21 void *ctx; 22 22 ··· 31 31 { 32 32 struct lz4_ctx *ctx = crypto_tfm_ctx(tfm); 33 33 34 - ctx->lz4_comp_mem = lz4_alloc_ctx(NULL); 34 + ctx->lz4_comp_mem = lz4_alloc_ctx(); 35 35 if (IS_ERR(ctx->lz4_comp_mem)) 36 36 return -ENOMEM; 37 37 38 38 return 0; 39 39 } 40 40 41 - static void lz4_free_ctx(struct crypto_scomp *tfm, void *ctx) 41 + static void lz4_free_ctx(void *ctx) 42 42 { 43 43 vfree(ctx); 44 44 } ··· 47 47 { 48 48 struct lz4_ctx *ctx = crypto_tfm_ctx(tfm); 49 49 50 - lz4_free_ctx(NULL, ctx->lz4_comp_mem); 50 + lz4_free_ctx(ctx->lz4_comp_mem); 51 51 } 52 52 53 53 static int __lz4_compress_crypto(const u8 *src, unsigned int slen,
+4 -4
crypto/lz4hc.c
··· 15 15 void *lz4hc_comp_mem; 16 16 }; 17 17 18 - static void *lz4hc_alloc_ctx(struct crypto_scomp *tfm) 18 + static void *lz4hc_alloc_ctx(void) 19 19 { 20 20 void *ctx; 21 21 ··· 30 30 { 31 31 struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); 32 32 33 - ctx->lz4hc_comp_mem = lz4hc_alloc_ctx(NULL); 33 + ctx->lz4hc_comp_mem = lz4hc_alloc_ctx(); 34 34 if (IS_ERR(ctx->lz4hc_comp_mem)) 35 35 return -ENOMEM; 36 36 37 37 return 0; 38 38 } 39 39 40 - static void lz4hc_free_ctx(struct crypto_scomp *tfm, void *ctx) 40 + static void lz4hc_free_ctx(void *ctx) 41 41 { 42 42 vfree(ctx); 43 43 } ··· 46 46 { 47 47 struct lz4hc_ctx *ctx = crypto_tfm_ctx(tfm); 48 48 49 - lz4hc_free_ctx(NULL, ctx->lz4hc_comp_mem); 49 + lz4hc_free_ctx(ctx->lz4hc_comp_mem); 50 50 } 51 51 52 52 static int __lz4hc_compress_crypto(const u8 *src, unsigned int slen,
+4 -4
crypto/lzo-rle.c
··· 15 15 void *lzorle_comp_mem; 16 16 }; 17 17 18 - static void *lzorle_alloc_ctx(struct crypto_scomp *tfm) 18 + static void *lzorle_alloc_ctx(void) 19 19 { 20 20 void *ctx; 21 21 ··· 30 30 { 31 31 struct lzorle_ctx *ctx = crypto_tfm_ctx(tfm); 32 32 33 - ctx->lzorle_comp_mem = lzorle_alloc_ctx(NULL); 33 + ctx->lzorle_comp_mem = lzorle_alloc_ctx(); 34 34 if (IS_ERR(ctx->lzorle_comp_mem)) 35 35 return -ENOMEM; 36 36 37 37 return 0; 38 38 } 39 39 40 - static void lzorle_free_ctx(struct crypto_scomp *tfm, void *ctx) 40 + static void lzorle_free_ctx(void *ctx) 41 41 { 42 42 kvfree(ctx); 43 43 } ··· 46 46 { 47 47 struct lzorle_ctx *ctx = crypto_tfm_ctx(tfm); 48 48 49 - lzorle_free_ctx(NULL, ctx->lzorle_comp_mem); 49 + lzorle_free_ctx(ctx->lzorle_comp_mem); 50 50 } 51 51 52 52 static int __lzorle_compress(const u8 *src, unsigned int slen,
+4 -4
crypto/lzo.c
··· 15 15 void *lzo_comp_mem; 16 16 }; 17 17 18 - static void *lzo_alloc_ctx(struct crypto_scomp *tfm) 18 + static void *lzo_alloc_ctx(void) 19 19 { 20 20 void *ctx; 21 21 ··· 30 30 { 31 31 struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); 32 32 33 - ctx->lzo_comp_mem = lzo_alloc_ctx(NULL); 33 + ctx->lzo_comp_mem = lzo_alloc_ctx(); 34 34 if (IS_ERR(ctx->lzo_comp_mem)) 35 35 return -ENOMEM; 36 36 37 37 return 0; 38 38 } 39 39 40 - static void lzo_free_ctx(struct crypto_scomp *tfm, void *ctx) 40 + static void lzo_free_ctx(void *ctx) 41 41 { 42 42 kvfree(ctx); 43 43 } ··· 46 46 { 47 47 struct lzo_ctx *ctx = crypto_tfm_ctx(tfm); 48 48 49 - lzo_free_ctx(NULL, ctx->lzo_comp_mem); 49 + lzo_free_ctx(ctx->lzo_comp_mem); 50 50 } 51 51 52 52 static int __lzo_compress(const u8 *src, unsigned int slen,
+2 -2
crypto/zstd.c
··· 103 103 return ret; 104 104 } 105 105 106 - static void *zstd_alloc_ctx(struct crypto_scomp *tfm) 106 + static void *zstd_alloc_ctx(void) 107 107 { 108 108 int ret; 109 109 struct zstd_ctx *ctx; ··· 134 134 zstd_decomp_exit(ctx); 135 135 } 136 136 137 - static void zstd_free_ctx(struct crypto_scomp *tfm, void *ctx) 137 + static void zstd_free_ctx(void *ctx) 138 138 { 139 139 __zstd_exit(ctx); 140 140 kfree_sensitive(ctx);
+3 -3
drivers/crypto/cavium/zip/zip_crypto.c
··· 236 236 } /* Legacy compress framework end */ 237 237 238 238 /* SCOMP framework start */ 239 - void *zip_alloc_scomp_ctx_deflate(struct crypto_scomp *tfm) 239 + void *zip_alloc_scomp_ctx_deflate(void) 240 240 { 241 241 int ret; 242 242 struct zip_kernel_ctx *zip_ctx; ··· 255 255 return zip_ctx; 256 256 } 257 257 258 - void *zip_alloc_scomp_ctx_lzs(struct crypto_scomp *tfm) 258 + void *zip_alloc_scomp_ctx_lzs(void) 259 259 { 260 260 int ret; 261 261 struct zip_kernel_ctx *zip_ctx; ··· 274 274 return zip_ctx; 275 275 } 276 276 277 - void zip_free_scomp_ctx(struct crypto_scomp *tfm, void *ctx) 277 + void zip_free_scomp_ctx(void *ctx) 278 278 { 279 279 struct zip_kernel_ctx *zip_ctx = ctx; 280 280
+3 -3
drivers/crypto/cavium/zip/zip_crypto.h
··· 67 67 const u8 *src, unsigned int slen, 68 68 u8 *dst, unsigned int *dlen); 69 69 70 - void *zip_alloc_scomp_ctx_deflate(struct crypto_scomp *tfm); 71 - void *zip_alloc_scomp_ctx_lzs(struct crypto_scomp *tfm); 72 - void zip_free_scomp_ctx(struct crypto_scomp *tfm, void *zip_ctx); 70 + void *zip_alloc_scomp_ctx_deflate(void); 71 + void *zip_alloc_scomp_ctx_lzs(void); 72 + void zip_free_scomp_ctx(void *zip_ctx); 73 73 int zip_scomp_compress(struct crypto_scomp *tfm, 74 74 const u8 *src, unsigned int slen, 75 75 u8 *dst, unsigned int *dlen, void *ctx);
+4 -4
include/crypto/internal/scompress.h
··· 31 31 * @calg: Cmonn algorithm data structure shared with acomp 32 32 */ 33 33 struct scomp_alg { 34 - void *(*alloc_ctx)(struct crypto_scomp *tfm); 35 - void (*free_ctx)(struct crypto_scomp *tfm, void *ctx); 34 + void *(*alloc_ctx)(void); 35 + void (*free_ctx)(void *ctx); 36 36 int (*compress)(struct crypto_scomp *tfm, const u8 *src, 37 37 unsigned int slen, u8 *dst, unsigned int *dlen, 38 38 void *ctx); ··· 73 73 74 74 static inline void *crypto_scomp_alloc_ctx(struct crypto_scomp *tfm) 75 75 { 76 - return crypto_scomp_alg(tfm)->alloc_ctx(tfm); 76 + return crypto_scomp_alg(tfm)->alloc_ctx(); 77 77 } 78 78 79 79 static inline void crypto_scomp_free_ctx(struct crypto_scomp *tfm, 80 80 void *ctx) 81 81 { 82 - return crypto_scomp_alg(tfm)->free_ctx(tfm, ctx); 82 + return crypto_scomp_alg(tfm)->free_ctx(ctx); 83 83 } 84 84 85 85 static inline int crypto_scomp_compress(struct crypto_scomp *tfm,