Re: [PATCH] crypto: use designated initializers for report structs

From: Herbert Xu

Date: Fri May 15 2026 - 06:43:25 EST


On Fri, May 08, 2026 at 12:57:17PM +0200, Thorsten Blum wrote:
> Use designated initializers for the report structs instead of clearing
> the struct with memset() and then copying fixed strings with strscpy()
> at runtime.
>
> This keeps the structs zero-initialized, lets the compiler diagnose
> oversized string literals, and makes the code easier to read.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> crypto/acompress.c | 8 +++-----
> crypto/aead.c | 10 ++++------
> crypto/ahash.c | 8 +++-----
> crypto/akcipher.c | 8 +++-----
> crypto/crypto_user.c | 14 ++++++--------
> crypto/kpp.c | 8 +++-----
> crypto/lskcipher.c | 10 ++++------
> crypto/rng.c | 8 +++-----
> crypto/scompress.c | 8 +++-----
> crypto/shash.c | 8 +++-----
> crypto/sig.c | 6 +++---
> crypto/skcipher.c | 10 ++++------
> 12 files changed, 42 insertions(+), 64 deletions(-)

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt