diff options
author | Krzysztof Kozlowski <[email protected]> | 2024-05-01 19:51:27 +0200 |
---|---|---|
committer | Mark Brown <[email protected]> | 2024-05-02 12:57:25 +0900 |
commit | 9723cab054d59d770cd1927f92fe315c26cc6a78 (patch) | |
tree | 30bd54ce233eb0d281f22de9f1a7d21b4f700a76 /lib/memory-notifier-error-inject.c | |
parent | 9f6bdb0aa1e9527e86b8640de5bb30f925b3774e (diff) |
ASoC: Use inline function for type safety in snd_soc_substream_to_rtd()
A common pattern in sound drivers is getting 'struct snd_soc_pcm_runtime'
from 'struct snd_pcm_substream' opaque pointer private_data field with
snd_soc_substream_to_rtd(). However 'private_data' appears in several
other structures as well, including 'struct snd_compr_stream'. The
field might not hold the same type for every structure, although seems
the case at least for 'struct snd_compr_stream', so code can easily make
a mistake by using macro for wrong structure passed as argument.
Switch from macro to inline function, so such mistake will be build-time
detectable.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions