Re: [PATCH] crypto: use designated initializers for report structs
From: Thorsten Blum
Date: Fri May 08 2026 - 16:11:46 EST
On Fri, May 08, 2026 at 06:40:13PM +0000, Eric Biggers wrote:
> 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>
>
> Did you verify that none of these structs contain any implicit padding?
Yes, I checked the structs manually and with pahole, which also reported
no holes. The structs only use char[64] followed by unsigned ints, so
implicit padding shouldn't be an issue.
Thanks,
Thorsten