linux/sound/soc/intel
Amadeusz Sławiński 49a407af0c ASoC: Intel: avs: Use lookup table to create modules
commit 1e744351bc upstream.

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>
Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2022-08-17 15:16:21 +02:00
..
atom ASoC: Intel: atom: use pm_runtime_resume_and_get() 2022-04-27 14:15:27 +01:00
avs ASoC: Intel: avs: Use lookup table to create modules 2022-08-17 15:16:21 +02:00
boards ASoC: Intel: sof_rt5682: Perform quirk check first in card late probe 2022-08-17 15:15:57 +02:00
catpt Revert "devcoredump: remove the useless gfp_t parameter in dev_coredumpv and dev_coredumpm" 2022-08-17 15:16:19 +02:00
common ASoC: Intel: common: fix typo for tplg naming 2022-05-26 14:43:26 +01:00
keembay Merge remote-tracking branch 'asoc/for-5.13' into asoc-next 2021-04-23 19:01:02 +01:00
skylake ASoC: Intel: Skylake: Correct the handling of fmt_config flexible array 2022-07-07 17:16:40 +01:00
Kconfig ASoC: Intel: avs: PCI driver implementation 2022-05-17 11:58:04 +01:00
Makefile ASoC: Intel: Introduce AVS driver 2022-03-11 16:23:54 +00:00