[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sound
Subject:    Re: [PATCH] ASoC: use inline function for type safety in snd_soc_substream_to_rtd()
From:       Krzysztof Kozlowski <krzysztof.kozlowski () linaro ! org>
Date:       2024-04-30 15:52:39
Message-ID: 41e2ac7b-3f24-493d-a244-1848ec8b079e () linaro ! org
[Download RAW message or body]

On 30/04/2024 16:56, Mark Brown wrote:
> On Tue, Apr 30, 2024 at 04:09:38PM +0200, Krzysztof Kozlowski wrote:
> 
>> -#define snd_soc_substream_to_rtd(substream) \
>> -	(struct snd_soc_pcm_runtime *)snd_pcm_substream_chip(substream)
>> +
>> +static inline struct snd_soc_pcm_runtime *
>> +snd_soc_substream_to_rtd(const struct snd_pcm_substream *substream)
>> +{
>> +	return substream->private_data;
>> +}
> 
> This is not an obvious direct substitution, we've skipped the
> snd_pcm_subsystem_chip() (which is also a macro, but that just suggests
> it could do with it's own cleanup) and the commit log didn't mention it.

Yes, you're right. I should keep snd_pcm_substream_chip().

Best regards,
Krzysztof


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic