crypto: sun8i-ss - remove redundant test
authorCorentin Labbe <clabbe@baylibre.com>
Mon, 2 May 2022 20:19:16 +0000 (20:19 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 13 May 2022 09:24:18 +0000 (17:24 +0800)
Some fallback tests were redundant with what sun8i_ss_hash_need_fallback() already do.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c

index ca4f280af35d22f11d30a09200fe64b75485bb4b..eaa0bbaf558117e8157c9b58cbce08314d2dc0ac 100644 (file)
@@ -288,21 +288,11 @@ int sun8i_ss_hash_digest(struct ahash_request *areq)
        struct sun8i_ss_alg_template *algt;
        struct sun8i_ss_dev *ss;
        struct crypto_engine *engine;
-       struct scatterlist *sg;
-       int nr_sgs, e, i;
+       int e;
 
        if (sun8i_ss_hash_need_fallback(areq))
                return sun8i_ss_hash_digest_fb(areq);
 
-       nr_sgs = sg_nents(areq->src);
-       if (nr_sgs > MAX_SG - 1)
-               return sun8i_ss_hash_digest_fb(areq);
-
-       for_each_sg(areq->src, sg, nr_sgs, i) {
-               if (sg->length % 4 || !IS_ALIGNED(sg->offset, sizeof(u32)))
-                       return sun8i_ss_hash_digest_fb(areq);
-       }
-
        algt = container_of(alg, struct sun8i_ss_alg_template, alg.hash);
        ss = algt->ss;