Skip to contentSkip to conversation

ASoC: fsl: fsl_dma: Use true/false for boolean init

PATCH Applied Fabio Estevam 3 participants 4 messages May 9, 2015 – May 11, 2015

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ASoC: fsl: fsl_dma: Use true/false for boolean init

From: Fabio Estevam <[email protected]>

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/

---
 sound/soc/fsl/fsl_dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/fsl/fsl_dma.c +2 -2
index 93d7e56..ccadefc 100644
@@ -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;
 }
Signature · 1 line
1.9.1
author reviewer
#1 lore raw

PATCH 2/2 ASoC: fsl: imx-mc13783: Simplify trivial if-return sequence

From: Fabio Estevam <[email protected]>

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/

---
 sound/soc/fsl/imx-mc13783.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/fsl/imx-mc13783.c +1 -5
index 9e6493d..bb04590 100644
@@ -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 = {
Signature · 1 line
1.9.1
Acked-by on v1 1/2
#2 lore raw
In reply to Fabio Estevam
Quoted 6 lines · Fabio Estevam

From: Fabio Estevam<[email protected]>

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.

Quoted 7 lines

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/

maintainer Applied
#3 lore raw
In reply to Fabio Estevam
Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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.