DPCM is already difficult to read, but now dpcm_dai_trigger_fe_be() even
difficult to read.
static int dpcm_dai_trigger_fe_be(.., fe_first)
{
^ if (fe_first) {
(A) ...
|(x) goto end;
v }
^
(B) ...
v
end:
return ...
}
It want to switch function call order by using "fe_first" for fe->be
order part (A), or be->fe order part (B). But the code is using "goto"
in last of (A) (=x).
Just use "if..else" for (A) (B) is easy to read and understand what it
want to do.
static int dpcm_dai_trigger_fe_be(.., fe_first)
{
^ if (fe_first) {
(A) ...
v }
^ else {
(B) ...
v }
return ...
}
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---
sound/soc/soc-pcm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 96776824d9daa..8a3073a506aa2 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2365,18 +2365,18 @@ static int dpcm_dai_trigger_fe_be(struct snd_pcm_substream *substream,
goto end;
ret = dpcm_be_dai_trigger(fe, substream->stream, cmd);
- goto end;
}
-
/* call trigger on the frontend after the backend. */
- ret = dpcm_be_dai_trigger(fe, substream->stream, cmd);
- if (ret < 0)
- goto end;
+ else {
+ ret = dpcm_be_dai_trigger(fe, substream->stream, cmd);
+ if (ret < 0)
+ goto end;
- dev_dbg(fe->dev, "ASoC: post trigger FE %s cmd %d\n",
- fe->dai_link->name, cmd);
+ dev_dbg(fe->dev, "ASoC: post trigger FE %s cmd %d\n",
+ fe->dai_link->name, cmd);
- ret = soc_pcm_trigger(substream, cmd);
+ ret = soc_pcm_trigger(substream, cmd);
+ }
end:
return snd_soc_ret(fe->dev, ret, "trigger FE cmd: %d failed\n", cmd);
}
--
2.43.0
[Index of Archives]
[Pulseaudio]
[Linux Audio Users]
[ALSA Devel]
[Fedora Desktop]
[Fedora SELinux]
[Big List of Linux Books]
[Yosemite News]
[KDE Users]