staging: greybus: fix stack size warning with UBSAN
commit 144779edf598e0896302c35a0926ef0b68f17c4b upstream.
clang warns about excessive stack usage in this driver when
UBSAN is enabled:
drivers/staging/greybus/audio_topology.c:977:12: error: stack frame size of 1836 bytes in function 'gbaudio_tplg_create_widget' [-Werror,-Wframe-larger-than=]
Rework this code to no longer use compound literals for
initializing the structure in each case, but instead keep
the common bits in a preallocated constant array and copy
them as needed.
Reviewed-by: Nick Desaulniers <firstname.lastname@example.org>
Reviewed-by: Alex Elder <email@example.com>
Signed-off-by: Arnd Bergmann <firstname.lastname@example.org>
[nathan: Address review comments from v1]
Signed-off-by: Nathan Chancellor <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>
1 file changed