diff options
author | Dan Streetman <ddstreet@ieee.org> | 2015-07-22 14:26:35 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-07-23 06:14:31 -0400 |
commit | 20fc311fc0e14d9f5ef72cfe785fd2b3f6339ab8 (patch) | |
tree | c7ab438836aa9ca7a2f058060592879d72fd5d83 /drivers/crypto/nx | |
parent | ee781b7ff3d8ab93bf99b1c3e1f0a29dda2a63e5 (diff) |
crypto: nx - use common code for both NX decompress success cases
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>
Diffstat (limited to 'drivers/crypto/nx')
-rw-r--r-- | drivers/crypto/nx/nx-842-crypto.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/crypto/nx/nx-842-crypto.c b/drivers/crypto/nx/nx-842-crypto.c index 3288a701c91b..51ca168a82e9 100644 --- a/drivers/crypto/nx/nx-842-crypto.c +++ b/drivers/crypto/nx/nx-842-crypto.c | |||
@@ -520,10 +520,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm, | |||
520 | if (ret) | 520 | if (ret) |
521 | goto unlock; | 521 | goto unlock; |
522 | 522 | ||
523 | *dlen = p.ototal; | 523 | goto success; |
524 | |||
525 | ret = 0; | ||
526 | goto unlock; | ||
527 | } | 524 | } |
528 | 525 | ||
529 | if (!hdr->groups) { | 526 | if (!hdr->groups) { |
@@ -557,6 +554,7 @@ static int nx842_crypto_decompress(struct crypto_tfm *tfm, | |||
557 | goto unlock; | 554 | goto unlock; |
558 | } | 555 | } |
559 | 556 | ||
557 | success: | ||
560 | *dlen = p.ototal; | 558 | *dlen = p.ototal; |
561 | 559 | ||
562 | pr_debug("decompress total slen %x dlen %x\n", slen, *dlen); | 560 | pr_debug("decompress total slen %x dlen %x\n", slen, *dlen); |