Re: [PATCH] EDAC: mem_repair: reduce stack usage in edac_mem_repair_get_desc()
From: Borislav Petkov
Date: Thu Jun 26 2025 - 10:42:18 EST
On Fri, Jun 20, 2025 at 01:41:28PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> Constructing an array on the stack adds complexity and can exceed the
> warning limit for per-function stack usage:
>
> drivers/edac/mem_repair.c:361:5: error: stack frame size (1296) exceeds limit (1280) in 'edac_mem_repair_get_desc' [-Werror,-Wframe-larger-than]
>
> Change this to have the actual attribute array allocated statically
> and then just add the instance number on the per-instance copy.
>
> Fixes: 699ea5219c4b ("EDAC: Add a memory repair control feature")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
> drivers/edac/mem_repair.c | 56 +++++++++++++++------------------------
> 1 file changed, 22 insertions(+), 34 deletions(-)
Applied, thanks.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette