Re: [PATCH 4.19.y-cip 16/57] ASoC: add for_each_dpcm_fe() macro


Kuninori Morimoto <kuninori.morimoto.gx@...>
 

Hi Pavel

+#define for_each_dpcm_fe(be, stream, dpcm) \
+ list_for_each_entry(dpcm, &(be)->dpcm[stream].fe_clients, list_fe)
It should be:

+#define for_each_dpcm_fe(be, stream, dpcm, list_de) \
+ list_for_each_entry(dpcm, &(be)->dpcm[stream].fe_clients, list_fe)
[accessing variables not passed as macro arguments is strange/surprising].
Ahh, OK. But, I would say, Yes and No.

Indeed, using not passed parameter in macro is strange.
But, this time, it is used at list_for_each_entry().
Last one is struct location/member, not parameter.

In this case, in order to use properly,
macro name is indicating "for what".

We have xx_fe and xx_be.

#define for_each_dpcm_fe(be, stream, _dpcm) \
list_for_each_entry(_dpcm, &(be)->dpcm[stream].fe_clients, list_fe)

#define for_each_dpcm_be(fe, stream, _dpcm) \
list_for_each_entry(_dpcm, &(fe)->dpcm[stream].be_clients, list_be)



Thank you for your help !!
Best regards
---
Kuninori Morimoto

Join cip-dev@lists.cip-project.org to automatically receive all group messages.