projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9aac6c0
)
RDMA/irdma: Use crypto_shash_digest() in irdma_ieq_check_mpacrc()
author
Eric Biggers
<ebiggers@google.com>
Sun, 29 Oct 2023 04:57:56 +0000
(21:57 -0700)
committer
Leon Romanovsky
<leon@kernel.org>
Mon, 13 Nov 2023 08:46:04 +0000
(10:46 +0200)
Simplify irdma_ieq_check_mpacrc() by using crypto_shash_digest() instead
of an init+update+final sequence. This should also improve performance.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Link:
https://lore.kernel.org/r/20231029045756.153943-1-ebiggers@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/irdma/utils.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/irdma/utils.c
b/drivers/infiniband/hw/irdma/utils.c
index 916bfe2a91eb22d31aedf725e3949c556fa81c75..0422787592d86ec3a7df2a601e786fa27636ebd2 100644
(file)
--- a/
drivers/infiniband/hw/irdma/utils.c
+++ b/
drivers/infiniband/hw/irdma/utils.c
@@
-1393,17
+1393,12
@@
int irdma_ieq_check_mpacrc(struct shash_desc *desc, void *addr, u32 len,
u32 val)
{
u32 crc = 0;
- int ret;
- int ret_code = 0;
- crypto_shash_init(desc);
- ret = crypto_shash_update(desc, addr, len);
- if (!ret)
- crypto_shash_final(desc, (u8 *)&crc);
+ crypto_shash_digest(desc, addr, len, (u8 *)&crc);
if (crc != val)
- ret
_code =
-EINVAL;
+ ret
urn
-EINVAL;
- return
ret_code
;
+ return
0
;
}
/**