mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
crypto: zip - remove the unneeded result variable
Return the value directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
72f6e0ea2b
commit
4edff849f7
1 changed files with 6 additions and 24 deletions
|
@ -198,22 +198,16 @@ static int zip_decompress(const u8 *src, unsigned int slen,
|
||||||
/* Legacy Compress framework start */
|
/* Legacy Compress framework start */
|
||||||
int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm)
|
int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
ret = zip_ctx_init(zip_ctx, 0);
|
return zip_ctx_init(zip_ctx, 0);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm)
|
int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
ret = zip_ctx_init(zip_ctx, 1);
|
return zip_ctx_init(zip_ctx, 1);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void zip_free_comp_ctx(struct crypto_tfm *tfm)
|
void zip_free_comp_ctx(struct crypto_tfm *tfm)
|
||||||
|
@ -227,24 +221,18 @@ int zip_comp_compress(struct crypto_tfm *tfm,
|
||||||
const u8 *src, unsigned int slen,
|
const u8 *src, unsigned int slen,
|
||||||
u8 *dst, unsigned int *dlen)
|
u8 *dst, unsigned int *dlen)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
ret = zip_compress(src, slen, dst, dlen, zip_ctx);
|
return zip_compress(src, slen, dst, dlen, zip_ctx);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int zip_comp_decompress(struct crypto_tfm *tfm,
|
int zip_comp_decompress(struct crypto_tfm *tfm,
|
||||||
const u8 *src, unsigned int slen,
|
const u8 *src, unsigned int slen,
|
||||||
u8 *dst, unsigned int *dlen)
|
u8 *dst, unsigned int *dlen)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
ret = zip_decompress(src, slen, dst, dlen, zip_ctx);
|
return zip_decompress(src, slen, dst, dlen, zip_ctx);
|
||||||
|
|
||||||
return ret;
|
|
||||||
} /* Legacy compress framework end */
|
} /* Legacy compress framework end */
|
||||||
|
|
||||||
/* SCOMP framework start */
|
/* SCOMP framework start */
|
||||||
|
@ -298,22 +286,16 @@ int zip_scomp_compress(struct crypto_scomp *tfm,
|
||||||
const u8 *src, unsigned int slen,
|
const u8 *src, unsigned int slen,
|
||||||
u8 *dst, unsigned int *dlen, void *ctx)
|
u8 *dst, unsigned int *dlen, void *ctx)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = ctx;
|
struct zip_kernel_ctx *zip_ctx = ctx;
|
||||||
|
|
||||||
ret = zip_compress(src, slen, dst, dlen, zip_ctx);
|
return zip_compress(src, slen, dst, dlen, zip_ctx);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int zip_scomp_decompress(struct crypto_scomp *tfm,
|
int zip_scomp_decompress(struct crypto_scomp *tfm,
|
||||||
const u8 *src, unsigned int slen,
|
const u8 *src, unsigned int slen,
|
||||||
u8 *dst, unsigned int *dlen, void *ctx)
|
u8 *dst, unsigned int *dlen, void *ctx)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct zip_kernel_ctx *zip_ctx = ctx;
|
struct zip_kernel_ctx *zip_ctx = ctx;
|
||||||
|
|
||||||
ret = zip_decompress(src, slen, dst, dlen, zip_ctx);
|
return zip_decompress(src, slen, dst, dlen, zip_ctx);
|
||||||
|
|
||||||
return ret;
|
|
||||||
} /* SCOMP framework end */
|
} /* SCOMP framework end */
|
||||||
|
|
Loading…
Add table
Reference in a new issue