diff options
author | Cezary Rojewski <cezary.rojewski@intel.com> | 2025-01-09 13:22:11 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-01-09 12:14:23 +0000 |
commit | 0ca529926c5d9d0a3c0b1609fb7034ab870e4770 (patch) | |
tree | 115d2db56741c7b97a5523a3c0d5c1a64da0ca4b | |
parent | 94aa347d34e079859a5378272c9452c728e4183a (diff) |
ASoC: Intel: avs: Clearly state assumptions of hw_params()
There are no NULL-checks for fe/be_hw_params as there is an implicit
assumption that framework opens valid DPCMs only. State that clearly.
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-9-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/intel/avs/pcm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index 5878cfdbbee5..4bfbcb5a5ae8 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -161,6 +161,7 @@ static int avs_dai_be_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dpcm *dpcm; be = snd_soc_substream_to_rtd(substream); + /* dpcm_fe_dai_open() guarantees the list is not empty at this point. */ for_each_dpcm_fe(be, substream->stream, dpcm) { fe = dpcm->fe; fe_hw_params = &fe->dpcm[substream->stream].hw_params; @@ -576,6 +577,7 @@ static int avs_dai_fe_hw_params(struct snd_pcm_substream *substream, hdac_stream(host_stream)->format_val = 0; fe = snd_soc_substream_to_rtd(substream); + /* dpcm_fe_dai_open() guarantees the list is not empty at this point. */ for_each_dpcm_be(fe, substream->stream, dpcm) { be = dpcm->be; be_hw_params = &be->dpcm[substream->stream].hw_params; |