forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crypto: compress - remove crt_u.compress (struct compress_tfm)
crt_u.compress (struct compress_tfm) is pointless because its two fields, ->cot_compress() and ->cot_decompress(), always point to crypto_compress() and crypto_decompress(). Remove this pointless indirection, and just make crypto_comp_compress() and crypto_comp_decompress() be direct calls to what used to be crypto_compress() and crypto_decompress(). Also remove the unused function crypto_comp_cast(). Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information
Showing
4 changed files
with
19 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,34 +6,27 @@ | |
* | ||
* Copyright (c) 2002 James Morris <[email protected]> | ||
*/ | ||
#include <linux/types.h> | ||
#include <linux/crypto.h> | ||
#include <linux/errno.h> | ||
#include <linux/string.h> | ||
#include "internal.h" | ||
|
||
static int crypto_compress(struct crypto_tfm *tfm, | ||
const u8 *src, unsigned int slen, | ||
u8 *dst, unsigned int *dlen) | ||
int crypto_comp_compress(struct crypto_comp *comp, | ||
const u8 *src, unsigned int slen, | ||
u8 *dst, unsigned int *dlen) | ||
{ | ||
struct crypto_tfm *tfm = crypto_comp_tfm(comp); | ||
|
||
return tfm->__crt_alg->cra_compress.coa_compress(tfm, src, slen, dst, | ||
dlen); | ||
} | ||
EXPORT_SYMBOL_GPL(crypto_comp_compress); | ||
|
||
static int crypto_decompress(struct crypto_tfm *tfm, | ||
const u8 *src, unsigned int slen, | ||
u8 *dst, unsigned int *dlen) | ||
int crypto_comp_decompress(struct crypto_comp *comp, | ||
const u8 *src, unsigned int slen, | ||
u8 *dst, unsigned int *dlen) | ||
{ | ||
struct crypto_tfm *tfm = crypto_comp_tfm(comp); | ||
|
||
return tfm->__crt_alg->cra_compress.coa_decompress(tfm, src, slen, dst, | ||
dlen); | ||
} | ||
|
||
int crypto_init_compress_ops(struct crypto_tfm *tfm) | ||
{ | ||
struct compress_tfm *ops = &tfm->crt_compress; | ||
|
||
ops->cot_compress = crypto_compress; | ||
ops->cot_decompress = crypto_decompress; | ||
|
||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(crypto_comp_decompress); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters