Skip to content

Commit

Permalink
crypto: nx - use common code for both NX decompress success cases
Browse files Browse the repository at this point in the history
Replace the duplicated finishing code (set destination buffer length and
set return code to 0) in the case of decompressing a buffer with no header
with a goto to the success case of decompressing a buffer with a header.

This is a trivial change that allows both success cases to use common code,
and includes the pr_debug() msg in both cases as well.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Dan Streetman authored and Herbert Xu committed Jul 23, 2015
1 parent ee781b7 commit 20fc311
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/crypto/nx/nx-842-crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm,
if (ret)
goto unlock;

*dlen = p.ototal;

ret = 0;
goto unlock;
goto success;
}

if (!hdr->groups) {
Expand Down Expand Up @@ -557,6 +554,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm,
goto unlock;
}

success:
*dlen = p.ototal;

pr_debug("decompress total slen %x dlen %x\n", slen, *dlen);
Expand Down

0 comments on commit 20fc311

Please sign in to comment.