* [PATCH 0/2] ASoC: omap: mcbsp: small cleanups for the sidetone code @ 2012-02-28 8:07 Peter Ujfalusi 2012-02-28 8:07 ` [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization Peter Ujfalusi 2012-02-28 8:07 ` [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer Peter Ujfalusi 0 siblings, 2 replies; 7+ messages in thread From: Peter Ujfalusi @ 2012-02-28 8:07 UTC (permalink / raw) To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Jarkko Nikula Hello, to make the code a bit nicer to look at. This series is on top of the McBSP move changeset: http://mailman.alsa-project.org/pipermail/alsa-devel/2012-February/049628.html Regards, Peter --- Peter Ujfalusi (2): ASoC: omap: mcbsp: Use uniform st_data pointer initialization ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer sound/soc/omap/mcbsp.c | 25 +++++++------------------ 1 files changed, 7 insertions(+), 18 deletions(-) -- 1.7.8.4 ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization 2012-02-28 8:07 [PATCH 0/2] ASoC: omap: mcbsp: small cleanups for the sidetone code Peter Ujfalusi @ 2012-02-28 8:07 ` Peter Ujfalusi 2012-02-28 12:40 ` Mark Brown 2012-02-28 8:07 ` [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer Peter Ujfalusi 1 sibling, 1 reply; 7+ messages in thread From: Peter Ujfalusi @ 2012-02-28 8:07 UTC (permalink / raw) To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Jarkko Nikula In this way we can save few lines, and have uniform way of initializing the st_data in all functions. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- sound/soc/omap/mcbsp.c | 21 +++++---------------- 1 files changed, 5 insertions(+), 16 deletions(-) diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index fe4734e..79f6da6 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -273,11 +273,9 @@ static void omap_st_chgain(struct omap_mcbsp *mcbsp) int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain) { - struct omap_mcbsp_st_data *st_data; + struct omap_mcbsp_st_data *st_data = mcbsp->st_data; int ret = 0; - st_data = mcbsp->st_data; - if (!st_data) return -ENOENT; @@ -298,11 +296,9 @@ int omap_st_set_chgain(struct omap_mcbsp *mcbsp, int channel, s16 chgain) int omap_st_get_chgain(struct omap_mcbsp *mcbsp, int channel, s16 *chgain) { - struct omap_mcbsp_st_data *st_data; + struct omap_mcbsp_st_data *st_data = mcbsp->st_data; int ret = 0; - st_data = mcbsp->st_data; - if (!st_data) return -ENOENT; @@ -337,9 +333,7 @@ static int omap_st_start(struct omap_mcbsp *mcbsp) int omap_st_enable(struct omap_mcbsp *mcbsp) { - struct omap_mcbsp_st_data *st_data; - - st_data = mcbsp->st_data; + struct omap_mcbsp_st_data *st_data = mcbsp->st_data; if (!st_data) return -ENODEV; @@ -368,11 +362,9 @@ static int omap_st_stop(struct omap_mcbsp *mcbsp) int omap_st_disable(struct omap_mcbsp *mcbsp) { - struct omap_mcbsp_st_data *st_data; + struct omap_mcbsp_st_data *st_data = mcbsp->st_data; int ret = 0; - st_data = mcbsp->st_data; - if (!st_data) return -ENODEV; @@ -386,14 +378,11 @@ int omap_st_disable(struct omap_mcbsp *mcbsp) int omap_st_is_enabled(struct omap_mcbsp *mcbsp) { - struct omap_mcbsp_st_data *st_data; - - st_data = mcbsp->st_data; + struct omap_mcbsp_st_data *st_data = mcbsp->st_data; if (!st_data) return -ENODEV; - return st_data->enabled; } -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization 2012-02-28 8:07 ` [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization Peter Ujfalusi @ 2012-02-28 12:40 ` Mark Brown 2012-02-28 19:34 ` Jarkko Nikula 0 siblings, 1 reply; 7+ messages in thread From: Mark Brown @ 2012-02-28 12:40 UTC (permalink / raw) To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Jarkko Nikula [-- Attachment #1.1: Type: text/plain, Size: 230 bytes --] On Tue, Feb 28, 2012 at 10:07:31AM +0200, Peter Ujfalusi wrote: > In this way we can save few lines, and have uniform way of initializing the > st_data in all functions. Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization 2012-02-28 12:40 ` Mark Brown @ 2012-02-28 19:34 ` Jarkko Nikula 0 siblings, 0 replies; 7+ messages in thread From: Jarkko Nikula @ 2012-02-28 19:34 UTC (permalink / raw) To: Mark Brown; +Cc: Peter Ujfalusi, alsa-devel, Liam Girdwood On 02/28/2012 02:40 PM, Mark Brown wrote: > On Tue, Feb 28, 2012 at 10:07:31AM +0200, Peter Ujfalusi wrote: >> In this way we can save few lines, and have uniform way of initializing the >> st_data in all functions. > > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer 2012-02-28 8:07 [PATCH 0/2] ASoC: omap: mcbsp: small cleanups for the sidetone code Peter Ujfalusi 2012-02-28 8:07 ` [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization Peter Ujfalusi @ 2012-02-28 8:07 ` Peter Ujfalusi 2012-02-28 12:40 ` Mark Brown 1 sibling, 1 reply; 7+ messages in thread From: Peter Ujfalusi @ 2012-02-28 8:07 UTC (permalink / raw) To: Liam Girdwood, Mark Brown; +Cc: alsa-devel, Jarkko Nikula The parent functions of omap_st_start/stop also checks the validity of the st_data pointer so we do not need to do it again inside of omap_st_start/stop Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- sound/soc/omap/mcbsp.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c index 79f6da6..5f6c21d 100644 --- a/sound/soc/omap/mcbsp.c +++ b/sound/soc/omap/mcbsp.c @@ -318,7 +318,7 @@ static int omap_st_start(struct omap_mcbsp *mcbsp) { struct omap_mcbsp_st_data *st_data = mcbsp->st_data; - if (st_data && st_data->enabled && !st_data->running) { + if (st_data->enabled && !st_data->running) { omap_st_fir_write(mcbsp, st_data->taps); omap_st_chgain(mcbsp); @@ -350,7 +350,7 @@ static int omap_st_stop(struct omap_mcbsp *mcbsp) { struct omap_mcbsp_st_data *st_data = mcbsp->st_data; - if (st_data && st_data->running) { + if (st_data->running) { if (!mcbsp->free) { omap_st_off(mcbsp); st_data->running = 0; -- 1.7.8.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer 2012-02-28 8:07 ` [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer Peter Ujfalusi @ 2012-02-28 12:40 ` Mark Brown 2012-02-28 19:34 ` Jarkko Nikula 0 siblings, 1 reply; 7+ messages in thread From: Mark Brown @ 2012-02-28 12:40 UTC (permalink / raw) To: Peter Ujfalusi; +Cc: alsa-devel, Liam Girdwood, Jarkko Nikula [-- Attachment #1.1: Type: text/plain, Size: 281 bytes --] On Tue, Feb 28, 2012 at 10:07:32AM +0200, Peter Ujfalusi wrote: > The parent functions of omap_st_start/stop also checks the validity of the > st_data pointer so we do not need to do it again inside of omap_st_start/stop Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> [-- Attachment #1.2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] [-- Attachment #2: Type: text/plain, Size: 0 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer 2012-02-28 12:40 ` Mark Brown @ 2012-02-28 19:34 ` Jarkko Nikula 0 siblings, 0 replies; 7+ messages in thread From: Jarkko Nikula @ 2012-02-28 19:34 UTC (permalink / raw) To: Mark Brown; +Cc: Peter Ujfalusi, alsa-devel, Liam Girdwood On 02/28/2012 02:40 PM, Mark Brown wrote: > On Tue, Feb 28, 2012 at 10:07:32AM +0200, Peter Ujfalusi wrote: >> The parent functions of omap_st_start/stop also checks the validity of the >> st_data pointer so we do not need to do it again inside of omap_st_start/stop > > Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com> ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-28 19:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-02-28 8:07 [PATCH 0/2] ASoC: omap: mcbsp: small cleanups for the sidetone code Peter Ujfalusi 2012-02-28 8:07 ` [PATCH 1/2] ASoC: omap: mcbsp: Use uniform st_data pointer initialization Peter Ujfalusi 2012-02-28 12:40 ` Mark Brown 2012-02-28 19:34 ` Jarkko Nikula 2012-02-28 8:07 ` [PATCH 2/2] ASoC: omap: mcbsp: Remove redundant checks for the st_data pointer Peter Ujfalusi 2012-02-28 12:40 ` Mark Brown 2012-02-28 19:34 ` Jarkko Nikula
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).