* [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var()
[not found] <20260921061120.29694-6-blum@kernel.org>
@ 2026-09-21 6:11 ` Thorsten Blum
2026-09-21 8:56 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-09-21 6:11 UTC (permalink / raw)
To: Linus Walleij, Imre Kaloz, Corentin Labbe, Herbert Xu,
David S. Miller
Cc: Thorsten Blum, linux-crypto, linux-arm-kernel, linux-kernel
Use memcpy_and_pad() instead of separate memcpy() and memset() calls to
simplify register_chain_var().
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
index fdda04672454..33e8e887a415 100644
--- a/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
+++ b/drivers/crypto/intel/ixp4xx/ixp4xx_crypto.c
@@ -707,8 +707,7 @@ static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target,
return -EAGAIN;
}
- memcpy(pad, key, key_len);
- memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len);
+ memcpy_and_pad(pad, HMAC_PAD_BLOCKLEN, key, key_len, 0);
for (i = 0; i < HMAC_PAD_BLOCKLEN; i++)
pad[i] ^= xpad;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var()
2026-09-21 6:11 ` [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var() Thorsten Blum
@ 2026-09-21 8:56 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2026-09-21 8:56 UTC (permalink / raw)
To: Thorsten Blum
Cc: Imre Kaloz, Corentin Labbe, Herbert Xu, David S. Miller,
linux-crypto, linux-arm-kernel, linux-kernel
On Mon, Sep 21, 2026 at 8:12 AM Thorsten Blum <blum@kernel.org> wrote:
> Use memcpy_and_pad() instead of separate memcpy() and memset() calls to
> simplify register_chain_var().
>
> Signed-off-by: Thorsten Blum <blum@kernel.org>
This makes sense.
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-21 8:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260921061120.29694-6-blum@kernel.org>
2026-09-21 6:11 ` [PATCH 3/5] crypto: ixp4xx - use memcpy_and_pad() in register_chain_var() Thorsten Blum
2026-09-21 8:56 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox