On 1/10/2025 4:25 AM, Kuninori Morimoto wrote:
> Hi Laurentiu
>
> Thank you for your reply
>
>>> - simple_priv_to_props(priv, rtd->id);
>>> + simple_priv_to_props(priv, rtd);
>> ah, thanks for the clarification! correct me if I'm wrong here but the issue
>> that I see with the suggested approach is that we have some places in which
>> simple_priv_to_props() is used before the RTD is created.
>>
>> Example scenario: in audio-graph-card2 we call graph_link_init() (which uses simple_priv_to_props)
>> before the card is registered (during which the RTD is created).
> Do you mean like this ?
>
> Before created RTD: ID is not yet updated : use simple_priv_to_props()
> After created RTD: ID is updated : use runtime_simple_priv_to_props()
>
> Is this correct ?
yep, pretty much.
> If so, do we need to use them differently ?
> In the end, it end up doing the same thing, I think.
yep, they do the exact same thing. The only difference is the way they do it. As for the usage, the "rule" would be:
if you have an RTD structure =>
use runtime_simple_priv_to_props(priv, rtd) if simple_priv_to_props(priv, rtd->id) might be invalid
otherwise =>
use simple_priv_to_props()
>
> If my understanding was correct, it will just makes people confuse, and I
> don't want to makes code complex. I think just adding comment why it
> don't/can't use rtd->id directly is simple and enough (almost all user
> don't care small detail of macros :) but what do you think ?
i agree, no need to overly-complicate things. Will just add a comment in code as you suggested.
Thanks for the input!
>
>
> Thank you for your help !!
>
> Best regards
> ---
> Kuninori Morimoto
[Index of Archives]
[Pulseaudio]
[Linux Audio Users]
[ALSA Devel]
[Fedora Desktop]
[Fedora SELinux]
[Big List of Linux Books]
[Yosemite News]
[KDE Users]