linux/sound/soc/intel/avs
Amadeusz Sławiński 1e744351bc
ASoC: Intel: avs: Use lookup table to create modules
As reported by Nathan, when building avs driver using clang with:
  CONFIG_COMPILE_TEST=y
  CONFIG_FORTIFY_SOURCE=y
  CONFIG_KASAN=y
  CONFIG_PCI=y
  CONFIG_SOUND=y
  CONFIG_SND=y
  CONFIG_SND_SOC=y
  CONFIG_SND_SOC_INTEL_AVS=y

there are reports of too big stack use, like:
  sound/soc/intel/avs/path.c:815:18: error: stack frame size (2176) exceeds limit (2048) in 'avs_path_create' [-Werror,-Wframe-larger-than]
  struct avs_path *avs_path_create(struct avs_dev *adev, u32 dma_id,
                   ^
  1 error generated.

This is apparently caused by inlining many calls to guid_equal which
inlines fortified memcpy, using 2 size_t variables.

Instead of hardcoding many calls to guid_equal, use lookup table with
one call, this improves stack usage.

Link: https://lore.kernel.org/alsa-devel/YtlzY9aYdbS4Y3+l@dev-arch.thelio-3990X/T/
Link: https://github.com/ClangBuiltLinux/linux/issues/1642
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reported-by: Nathan Chancellor <nathan@kernel.org>
Build-tested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220722111959.2588597-1-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
2022-07-22 13:40:02 +01:00
..
boards ASoC: Intel: avs: Fix i2s_test card name initialization 2022-07-06 12:10:48 +01:00
apl.c ASoC: Intel: avs: APL-based platforms support 2022-05-17 11:58:08 +01:00
avs.h ASoC: Intel: avs: APL-based platforms support 2022-05-17 11:58:08 +01:00
board_selection.c ASoC: Intel: avs: Fix build error on arc, m68k and sparc 2022-05-30 16:08:33 +02:00
cldma.c ASoC: Intel: avs: Replace hardcodes with SD_CTL_STREAM_RESET 2022-07-08 18:53:26 +01:00
cldma.h ASoC: Intel: avs: Implement CLDMA transfer 2022-03-11 16:24:08 +00:00
core.c ASoC: Intel: avs: Use helper function to set up DMA 2022-07-08 18:53:24 +01:00
dsp.c ASoC: Intel: avs: Relax DSP core transition timings 2022-07-08 18:53:19 +01:00
ipc.c ASoC: Intel: avs: Copy only as many RX bytes as necessary 2022-07-08 18:53:20 +01:00
loader.c ASoC: Intel: avs: Update AVS_FW_INIT_TIMEOUT_US declaration 2022-07-08 18:53:29 +01:00
Makefile ASoC: Intel: avs: Add HDAudio machine board 2022-06-06 12:33:12 +01:00
messages.c ASoC: Intel: avs: Lower UNLOAD_MULTIPLE_MODULES IPC timeout 2022-07-08 18:53:28 +01:00
messages.h ASoC: Intel: avs: APL-based platforms support 2022-05-17 11:58:08 +01:00
path.c ASoC: Intel: avs: Use lookup table to create modules 2022-07-22 13:40:02 +01:00
path.h ASoC: Intel: avs: Configure modules according to their type 2022-04-19 12:04:04 +01:00
pcm.c ASoC: Intel: avs: Remove now redundant non_legacy_dai_naming flag 2022-06-27 13:17:29 +01:00
registers.h ASoC: Intel: avs: APL-based platforms support 2022-05-17 11:58:08 +01:00
skl.c ASoC: Intel: avs: SKL-based platforms support 2022-05-17 11:58:07 +01:00
topology.c ASoC: Intel: avs: Assign I2S gateway when parsing topology 2022-07-08 18:53:18 +01:00
topology.h ASoC: Intel: avs: Add topology loading operations 2022-04-19 12:03:56 +01:00
trace.c ASoC: Intel: avs: Event tracing 2022-05-17 11:58:01 +01:00
trace.h ASoC: Intel: avs: Event tracing 2022-05-17 11:58:01 +01:00
utils.c ASoC: Intel: avs: Prepare for firmware tracing 2022-05-17 11:57:59 +01:00