[alsa-devel] [PATCH 2/7] ASoC: DAPM: Pass snd_dapm_soc_update as parameter

Lars-Peter Clausen lars at metafoo.de
Thu Apr 28 23:24:38 CEST 2011

On 04/28/2011 10:58 PM, Mark Brown wrote:
> On Thu, Apr 28, 2011 at 10:39:08PM +0200, Lars-Peter Clausen wrote:
>> On 04/28/2011 09:40 PM, Mark Brown wrote:
>  [...]
>>> TBH I'm not sure how much of a help I find this, it's nice to not have
>>> to pass the operation we're doing about all the time especially if we
>>> end up using more context information in the middle of the operation
>>> (which I suspect we may end up doing).  You still have to work back
>>> through the call chain to find where the data came from.
>> Well, but you know that it is a parameter to the function call. With the
>> current scheme you don't know this immediately. Right now dapm->update is some
>> random global variable and it is not quite clear that it is only valid for the
>> time dapm_power_widgets is called.
> It should be valid at any time, it's cleared after use. 

But you only know that when looking at all callers, which is my point.
Being part of the dapm struct which is available to all drivers doesn't make
this easier.

> It only makes sense when something is in the middle of doing an update. Half
> of the thing for me is that we can now grep for actual users without seeing
> things that are just bouncing the data around.

Hm. I won't argue to death here. I could only repeat what I've said before.
But if we keep passing it indirectly we should at least make the struct opaque
to the world outside of soc-dapm and move the update pointer from
snd_soc_dapm_context to snd_soc_card.

- Lars

More information about the Alsa-devel mailing list