Commit 46e2fcbc authored by Corentin Labbe's avatar Corentin Labbe Committed by Herbert Xu

crypto: sun8i-ss - remove redundant test

Some fallback tests were redundant with what sun8i_ss_hash_need_fallback() already do.
Signed-off-by: default avatarCorentin Labbe <clabbe@baylibre.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c149e476
...@@ -288,21 +288,11 @@ int sun8i_ss_hash_digest(struct ahash_request *areq) ...@@ -288,21 +288,11 @@ int sun8i_ss_hash_digest(struct ahash_request *areq)
struct sun8i_ss_alg_template *algt; struct sun8i_ss_alg_template *algt;
struct sun8i_ss_dev *ss; struct sun8i_ss_dev *ss;
struct crypto_engine *engine; struct crypto_engine *engine;
struct scatterlist *sg; int e;
int nr_sgs, e, i;
if (sun8i_ss_hash_need_fallback(areq)) if (sun8i_ss_hash_need_fallback(areq))
return sun8i_ss_hash_digest_fb(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); algt = container_of(alg, struct sun8i_ss_alg_template, alg.hash);
ss = algt->ss; ss = algt->ss;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment