crypto: inside-secure - remove useless check
authorAntoine Tenart <antoine.tenart@bootlin.com>
Mon, 27 May 2019 14:50:56 +0000 (16:50 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 6 Jun 2019 06:38:55 +0000 (14:38 +0800)
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>
drivers/crypto/inside-secure/safexcel_hash.c

index a7cee9ed3789a8ab169984da0c515489b64419fc..58ce480690eb03e19796f45ec6b1cb434430fba0 100644 (file)
@@ -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;
                }
        }