Message ID | 87lfb2pg8a.wl-kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | ASoC: soc-pcm: cleanup each functions | expand |
On 3/4/21 7:00 PM, Kuninori Morimoto wrote: > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > At dpcm_be_dai_startup_unwind(), it indicates error message at (1) > if this function was called with no users. > But, it doesn't use "continue" here. Thus, it will be minus > users at (2). suggested edit: "Thus, users will be a negative number at (2)" > > void dpcm_be_dai_startup_unwind(...) > { > ... > for_each_dpcm_be(...) { > ... > (1) if (be->dpcm[stream].users == 0) > dev_err(...); > > (2) if (--be->dpcm[stream].users != 0) > continue;
Hi Pierre-Louis, Mark Thank you for your review. > > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> > > > > At dpcm_be_dai_startup_unwind(), it indicates error message at (1) > > if this function was called with no users. > > But, it doesn't use "continue" here. Thus, it will be minus > > users at (2). > > suggested edit: > > "Thus, users will be a negative number at (2)" Ah it is better :) Mark, can I repost it ? I'm happy if you tidyup it if you are OK for appling. Thank you for your help !! Best regards --- Kuninori Morimoto
On Mon, Mar 08, 2021 at 07:37:28AM +0900, Kuninori Morimoto wrote: > Ah it is better :) > Mark, can I repost it ? Sure.
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 910a6afe9f48..626d6e0a3a15 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1432,10 +1432,12 @@ static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe, struct snd_pcm_substream *be_substream = snd_soc_dpcm_get_substream(be, stream); - if (be->dpcm[stream].users == 0) + if (be->dpcm[stream].users == 0) { dev_err(be->dev, "ASoC: no users %s at close - state %d\n", stream ? "capture" : "playback", be->dpcm[stream].state); + continue; + } if (--be->dpcm[stream].users != 0) continue; @@ -1472,10 +1474,12 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) continue; /* first time the dpcm is open ? */ - if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) + if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) { dev_err(be->dev, "ASoC: too many users %s at open %d\n", stream ? "capture" : "playback", be->dpcm[stream].state); + continue; + } if (be->dpcm[stream].users++ != 0) continue; @@ -1517,10 +1521,12 @@ int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) if (!snd_soc_dpcm_be_can_update(fe, be, stream)) continue; - if (be->dpcm[stream].users == 0) + if (be->dpcm[stream].users == 0) { dev_err(be->dev, "ASoC: no users %s at close %d\n", stream ? "capture" : "playback", be->dpcm[stream].state); + continue; + } if (--be->dpcm[stream].users != 0) continue;