Skip to content

Commit 4edff84

Browse files
ye xingchenherbertx
authored andcommitted
crypto: zip - remove the unneeded result variable
Return the value directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <[email protected]> Signed-off-by: ye xingchen <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 72f6e0e commit 4edff84

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

drivers/crypto/cavium/zip/zip_crypto.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,16 @@ static int zip_decompress(const u8 *src, unsigned int slen,
198198
/* Legacy Compress framework start */
199199
int zip_alloc_comp_ctx_deflate(struct crypto_tfm *tfm)
200200
{
201-
int ret;
202201
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
203202

204-
ret = zip_ctx_init(zip_ctx, 0);
205-
206-
return ret;
203+
return zip_ctx_init(zip_ctx, 0);
207204
}
208205

209206
int zip_alloc_comp_ctx_lzs(struct crypto_tfm *tfm)
210207
{
211-
int ret;
212208
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
213209

214-
ret = zip_ctx_init(zip_ctx, 1);
215-
216-
return ret;
210+
return zip_ctx_init(zip_ctx, 1);
217211
}
218212

219213
void zip_free_comp_ctx(struct crypto_tfm *tfm)
@@ -227,24 +221,18 @@ int zip_comp_compress(struct crypto_tfm *tfm,
227221
const u8 *src, unsigned int slen,
228222
u8 *dst, unsigned int *dlen)
229223
{
230-
int ret;
231224
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
232225

233-
ret = zip_compress(src, slen, dst, dlen, zip_ctx);
234-
235-
return ret;
226+
return zip_compress(src, slen, dst, dlen, zip_ctx);
236227
}
237228

238229
int zip_comp_decompress(struct crypto_tfm *tfm,
239230
const u8 *src, unsigned int slen,
240231
u8 *dst, unsigned int *dlen)
241232
{
242-
int ret;
243233
struct zip_kernel_ctx *zip_ctx = crypto_tfm_ctx(tfm);
244234

245-
ret = zip_decompress(src, slen, dst, dlen, zip_ctx);
246-
247-
return ret;
235+
return zip_decompress(src, slen, dst, dlen, zip_ctx);
248236
} /* Legacy compress framework end */
249237

250238
/* SCOMP framework start */
@@ -298,22 +286,16 @@ int zip_scomp_compress(struct crypto_scomp *tfm,
298286
const u8 *src, unsigned int slen,
299287
u8 *dst, unsigned int *dlen, void *ctx)
300288
{
301-
int ret;
302289
struct zip_kernel_ctx *zip_ctx = ctx;
303290

304-
ret = zip_compress(src, slen, dst, dlen, zip_ctx);
305-
306-
return ret;
291+
return zip_compress(src, slen, dst, dlen, zip_ctx);
307292
}
308293

309294
int zip_scomp_decompress(struct crypto_scomp *tfm,
310295
const u8 *src, unsigned int slen,
311296
u8 *dst, unsigned int *dlen, void *ctx)
312297
{
313-
int ret;
314298
struct zip_kernel_ctx *zip_ctx = ctx;
315299

316-
ret = zip_decompress(src, slen, dst, dlen, zip_ctx);
317-
318-
return ret;
300+
return zip_decompress(src, slen, dst, dlen, zip_ctx);
319301
} /* SCOMP framework end */

0 commit comments

Comments
 (0)