]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: sun8i-ce-hash - remove duplicated fallback checks
authorOvidiu Panait <ovidiu.panait.oss@gmail.com>
Tue, 1 Apr 2025 19:23:17 +0000 (22:23 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 8 Apr 2025 07:54:38 +0000 (15:54 +0800)
Remove duplicated fallback checks in sun8i_ce_hash_digest(). The same
checks are already done previously in sun8i_ce_hash_need_fallback().

Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c

index 3f9d79ea01aaa671cfd41214fd8d16278df96955..2c2d285de154eb1d58c6ca5df58f17999f6fe3b0 100644 (file)
@@ -244,21 +244,11 @@ int sun8i_ce_hash_digest(struct ahash_request *areq)
        struct sun8i_ce_alg_template *algt;
        struct sun8i_ce_dev *ce;
        struct crypto_engine *engine;
-       struct scatterlist *sg;
-       int nr_sgs, e, i;
+       int e;
 
        if (sun8i_ce_hash_need_fallback(areq))
                return sun8i_ce_hash_digest_fb(areq);
 
-       nr_sgs = sg_nents_for_len(areq->src, areq->nbytes);
-       if (nr_sgs > MAX_SG - 1)
-               return sun8i_ce_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_ce_hash_digest_fb(areq);
-       }
-
        algt = container_of(alg, struct sun8i_ce_alg_template, alg.hash.base);
        ce = algt->ce;