Skip to content

Commit

Permalink
crypto: inside-secure - remove useless check
Browse files Browse the repository at this point in the history
When sending an ahash request, the code checks for the extra variable
not to be 0. This check is useless as the extra variable can't be 0 at
this point (it is checked on the line just before).

This patch does not modify the driver behaviour in any way.

Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Antoine Tenart authored and Herbert Xu committed Jun 6, 2019
1 parent 0733eab commit 709ecc1
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions drivers/crypto/inside-secure/safexcel_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,17 @@ static int safexcel_ahash_send_req(struct crypto_async_request *async, int ring,
if (!extra)
extra = crypto_ahash_blocksize(ahash);

if (extra) {
sg_pcopy_to_buffer(areq->src, sg_nents(areq->src),
req->cache_next, extra,
areq->nbytes - extra);

queued -= extra;
len -= extra;

if (!queued) {
*commands = 0;
*results = 0;
return 0;
}
sg_pcopy_to_buffer(areq->src, sg_nents(areq->src),
req->cache_next, extra,
areq->nbytes - extra);

queued -= extra;
len -= extra;

if (!queued) {
*commands = 0;
*results = 0;
return 0;
}
}

Expand Down

0 comments on commit 709ecc1

Please sign in to comment.