alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] ASoC: merge soc_compr_open() rollback and soc_compr_free()
@ 2020-11-18 23:49 Kuninori Morimoto
  2020-11-18 23:49 ` [PATCH 1/5] ASoC: soc-compress: move soc_compr_free() next to soc_compr_open() Kuninori Morimoto
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Kuninori Morimoto @ 2020-11-18 23:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

	static int soc_compr_open(xxx)
	{
		...
		if (ret < 0)
			goto xxx_err;
		...
		return 0;

 ^	machine_err:
 |		...
 |	out:
(A)		...
 |	pm_err:
 |		...
 v		return ret;
	}

This kind of duplicated code can be a hotbed of bugs,
thus, this patch-set share soc_compr_free() and rollback.

Kuninori Morimoto (5):
  ASoC: soc-compress: move soc_compr_free() next to soc_compr_open()
  ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()
  ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
  ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()
  ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()

 include/sound/soc-component.h |   6 +-
 include/sound/soc-dai.h       |   4 +-
 include/sound/soc-link.h      |   3 +-
 include/sound/soc.h           |   1 +
 sound/soc/soc-component.c     |  17 +++--
 sound/soc/soc-compress.c      | 115 +++++++++++++++++-----------------
 sound/soc/soc-dai.c           |  13 +++-
 sound/soc/soc-link.c          |  11 +++-
 8 files changed, 95 insertions(+), 75 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-26 20:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 23:49 [PATCH 0/5] ASoC: merge soc_compr_open() rollback and soc_compr_free() Kuninori Morimoto
2020-11-18 23:49 ` [PATCH 1/5] ASoC: soc-compress: move soc_compr_free() next to soc_compr_open() Kuninori Morimoto
2020-11-18 23:50 ` [PATCH 2/5] ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown() Kuninori Morimoto
2020-11-18 23:50 ` [PATCH 3/5] ASoC: soc-component: add mark for snd_soc_component_compr_open/free() Kuninori Morimoto
2020-11-18 23:50 ` [PATCH 4/5] ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown() Kuninori Morimoto
2020-11-18 23:50 ` [PATCH 5/5] ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free() Kuninori Morimoto
2020-11-26 20:05 ` [PATCH 0/5] ASoC: merge soc_compr_open() rollback and soc_compr_free() Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).