[PATCH 2/7] crypto: stm32/hash: Simplify code

lionel.debieve at foss.st.com lionel.debieve at foss.st.com
Tue Jan 3 00:12:24 PST 2023


Hi Linus

Acked-by: Lionel Debieve <lionel.debieve at foss.st.com>


ST Restricted

-----Original Message-----
From: Linus Walleij <linus.walleij at linaro.org> 
Sent: Wednesday, December 28, 2022 12:04 AM
To: Herbert Xu <herbert at gondor.apana.org.au>; David S. Miller <davem at davemloft.net>; Rob Herring <robh+dt at kernel.org>; Krzysztof Kozlowski <krzysztof.kozlowski+dt at linaro.org>; Maxime Coquelin <mcoquelin.stm32 at gmail.com>; Alexandre Torgue <alexandre.torgue at foss.st.com>; Lionel Debieve <lionel.debieve at foss.st.com>
Cc: linux-crypto at vger.kernel.org; devicetree at vger.kernel.org; linux-stm32 at st-md-mailman.stormreply.com; linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org; Linus Walleij <linus.walleij at linaro.org>
Subject: [PATCH 2/7] crypto: stm32/hash: Simplify code

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.

Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 drivers/crypto/stm32/stm32-hash.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c
index d33006d43f76..0473ced7b4ea 100644
--- a/drivers/crypto/stm32/stm32-hash.c
+++ b/drivers/crypto/stm32/stm32-hash.c
@@ -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;
--
2.38.1




More information about the linux-arm-kernel mailing list