Skip to content

Commit

Permalink
crypto: stm32/hash - Simplify code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
linusw authored and herbertx committed Feb 3, 2023
1 parent 85f3fc5 commit 2d27267
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/crypto/stm32/stm32-hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2d27267

Please sign in to comment.