public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC] ASoC: simple-card-utils: fix priv->dai_props indexing
Date: Sat, 11 Jan 2025 03:10:28 +0200	[thread overview]
Message-ID: <709f3aba-b681-4b43-947a-770227cf0afa@gmail.com> (raw)
In-Reply-To: <87cygvwgks.wl-kuninori.morimoto.gx@renesas.com>




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


      reply	other threads:[~2025-01-11  1:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20 15:12 [PATCH RFC] ASoC: simple-card-utils: fix priv->dai_props indexing Laurentiu Mihalcea
2024-12-23  0:48 ` Kuninori Morimoto
2025-01-08 11:00   ` Laurentiu Mihalcea
2025-01-09  0:07     ` Kuninori Morimoto
2025-01-10  0:26       ` Laurentiu Mihalcea
2025-01-10  2:25         ` Kuninori Morimoto
2025-01-11  1:10           ` Laurentiu Mihalcea [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=709f3aba-b681-4b43-947a-770227cf0afa@gmail.com \
    --to=laurentiumihalcea111@gmail.com \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox