Skip to contentSkip to conversation

ASoC: qcom: Return an error for invalid PCM trigger command

PATCH Applied Takashi Iwai 3 participants 3 messages Apr 13, 2015 – Apr 15, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: qcom: Return an error for invalid PCM trigger command

Fix a compile warning
sound/soc/qcom/lpass-cpu.c: In function ‘lpass_cpu_daiops_trigger’:
sound/soc/qcom/lpass-cpu.c:224:2: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]

    return ret;
      ^

Although switch () lists the most of existing cases, it's still better to cover the rest as an error properly.

---
 sound/soc/qcom/lpass-cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/qcom/lpass-cpu.c +1 -1
index 6698d058de29..dc790abaa331 100644
@@ -194,7 +194,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream,
 		int cmd, struct snd_soc_dai *dai)
 {
 	struct lpass_data *drvdata = snd_soc_dai_get_drvdata(dai);
-	int ret;
+	int ret = -EINVAL;
 
 	switch (cmd) {
 	case SNDRV_PCM_TRIGGER_START:
Signature · 6 lines
2.3.5

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Takashi Iwai

Fix a compile warning
sound/soc/qcom/lpass-cpu.c: In function ???lpass_cpu_daiops_trigger???:
sound/soc/qcom/lpass-cpu.c:224:2: warning: ???ret??? may be used uninitialized in this function [-Wmaybe-uninitialized]

    return ret;
      ^
Quoted 7 lines

Although switch () lists the most of existing cases, it's still better to cover the rest as an error properly.

---
 sound/soc/qcom/lpass-cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 4 lines
Kenneth Westfield
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, 
a Linux Foundation Collaborative Project
maintainer Applied
#2 lore raw
In reply to Takashi Iwai
Quoted 2 lines · Takashi Iwai

Fix a compile warning
sound/soc/qcom/lpass-cpu.c: In function ‘lpass_cpu_daiops_trigger’:

Applied, thanks.