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 <email@example.com>
Reviewed-by: Alex Elder <firstname.lastname@example.org>
Signed-off-by: Arnd Bergmann <email@example.com>
[nathan: Address review comments from v1]
Signed-off-by: Nathan Chancellor <firstname.lastname@example.org>
Signed-off-by: Greg Kroah-Hartman <email@example.com>
1 file changed