public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init
@ 2015-05-09 15:45 Fabio Estevam
  2015-05-09 15:45 ` [PATCH 2/2] ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2015-05-09 15:45 UTC (permalink / raw)
  To: broonie; +Cc: Fabio Estevam, alsa-devel, timur

From: Fabio Estevam <fabio.estevam@freescale.com>

Bool initializations should use true and false.  Bool tests don't need
comparisons.  Based on contributions from Joe Perches, Rusty Russell
and Bruce W Allan.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/boolinit.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/fsl_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index 93d7e56..ccadefc 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -445,7 +445,7 @@ static int fsl_dma_open(struct snd_pcm_substream *substream)
 		return ret;
 	}
 
-	dma->assigned = 1;
+	dma->assigned = true;
 
 	snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
 	snd_soc_set_runtime_hwparams(substream, &fsl_dma_hardware);
@@ -814,7 +814,7 @@ static int fsl_dma_close(struct snd_pcm_substream *substream)
 		substream->runtime->private_data = NULL;
 	}
 
-	dma->assigned = 0;
+	dma->assigned = false;
 
 	return 0;
 }
-- 
1.9.1

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

* [PATCH 2/2] ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence
  2015-05-09 15:45 [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Fabio Estevam
@ 2015-05-09 15:45 ` Fabio Estevam
  2015-05-09 15:47 ` [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Timur Tabi
  2015-05-11 15:14 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2015-05-09 15:45 UTC (permalink / raw)
  To: broonie; +Cc: Fabio Estevam, alsa-devel, timur

From: Fabio Estevam <fabio.estevam@freescale.com>

Simplify a trivial if-return sequence.  Possibly combine with a
preceding function call.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/simple_return.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/fsl/imx-mc13783.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c
index 9e6493d..bb04590 100644
--- a/sound/soc/fsl/imx-mc13783.c
+++ b/sound/soc/fsl/imx-mc13783.c
@@ -45,11 +45,7 @@ static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream,
 	if (ret)
 		return ret;
 
-	ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 16);
-	if (ret)
-		return ret;
-
-	return 0;
+	return snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 16);
 }
 
 static struct snd_soc_ops imx_mc13783_hifi_ops = {
-- 
1.9.1

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

* Re: [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init
  2015-05-09 15:45 [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Fabio Estevam
  2015-05-09 15:45 ` [PATCH 2/2] ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence Fabio Estevam
@ 2015-05-09 15:47 ` Timur Tabi
  2015-05-11 15:14 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Timur Tabi @ 2015-05-09 15:47 UTC (permalink / raw)
  To: Fabio Estevam, broonie; +Cc: Fabio Estevam, alsa-devel

Fabio Estevam wrote:
> From: Fabio Estevam<fabio.estevam@freescale.com>
>
> Bool initializations should use true and false.  Bool tests don't need
> comparisons.  Based on contributions from Joe Perches, Rusty Russell
> and Bruce W Allan.
>
> The semantic patch that makes this change is available
> in scripts/coccinelle/misc/boolinit.cocci.
>
> More information about semantic patching is available at
> http://coccinelle.lip6.fr/
>
> Signed-off-by: Fabio Estevam<fabio.estevam@freescale.com>

Acked-by: Timur Tabi <timur@tabi.org>

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

* Re: [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init
  2015-05-09 15:45 [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Fabio Estevam
  2015-05-09 15:45 ` [PATCH 2/2] ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence Fabio Estevam
  2015-05-09 15:47 ` [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Timur Tabi
@ 2015-05-11 15:14 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2015-05-11 15:14 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Fabio Estevam, alsa-devel, timur


[-- Attachment #1.1: Type: text/plain, Size: 314 bytes --]

On Sat, May 09, 2015 at 12:45:52PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Bool initializations should use true and false.  Bool tests don't need
> comparisons.  Based on contributions from Joe Perches, Rusty Russell
> and Bruce W Allan.

Applied both, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

end of thread, other threads:[~2015-05-11 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-09 15:45 [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Fabio Estevam
2015-05-09 15:45 ` [PATCH 2/2] ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence Fabio Estevam
2015-05-09 15:47 ` [PATCH 1/2] ASoC: fsl: fsl_dma: Use true/false for boolean init Timur Tabi
2015-05-11 15:14 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox