crypto: stm32/hash - Simplify code
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 25 Jan 2023 00:23:07 +0000 (01:23 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 3 Feb 2023 04:54:55 +0000 (12:54 +0800)
We are passing (rctx->flags & HASH_FLAGS_FINUP) as indicator
for the final request but we already know this to be true since
we are in the (final) arm of an if-statement set from the same
flag. Just open-code it as true.

Acked-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/stm32/stm32-hash.c

index d33006d..0473ced 100644 (file)
@@ -399,8 +399,7 @@ static int stm32_hash_update_cpu(struct stm32_hash_dev *hdev)
        if (final) {
                bufcnt = rctx->bufcnt;
                rctx->bufcnt = 0;
-               err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt,
-                                         (rctx->flags & HASH_FLAGS_FINUP));
+               err = stm32_hash_xmit_cpu(hdev, rctx->buffer, bufcnt, 1);
        }
 
        return err;