Skip to contentSkip to conversation

ASoC: wm8994: missing break in wm8994_aif3_hw_params()

PATCH Applied Dan Carpenter 3 participants 4 messages Apr 30, 2013

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

PATCH 1/1 ASoC: wm8994: missing break in wm8994_aif3_hw_params()

The missing break here means that we always return early and the function is a no-op.

---

sound/soc/codecs/wm8994.c +1 -0
index 14094f5..1eb152c 100644
@@ -2882,6 +2882,7 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
 		default:
 			return 0;
 		}
+		break;
 	default:
 		return 0;
 	}
#1 lore raw

Am 30.04.2013 09:24, schrieb Dan Carpenter:

Quoted 11 lines

The missing break here means that we always return early and the function is a no-op.

---

sound/soc/codecs/wm8994.c +0 -0
index 14094f5..1eb152c 100644

sound/soc/codecs/wm8994.c static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream, · line 2888

Quoted 7 lines
sound/soc/codecs/wm8994.c +1 -0
@@ -2882,6 +2882,7 @@ static int wm8994_aif3_hw_params(struct snd_pcm_substream *substream,
 		default:
 			return 0;
 		}
+		break;
 	default:
 		return 0;
 	}

the patch seems ok, but i would question the wisdom of a nested switch here, obviously the readability suffers and since it is only one case it seems better to be replaced it with

if (dai->id != 3) return 0;

Please can the maintainer comment on that ?

just my 2 cents,
wh

maintainer
#2 lore raw
Quoted 3 lines · walter harms

the patch seems ok, but i would question the wisdom of a nested switch here, obviously the readability suffers and since it is only one case it seems better to be replaced it with

I don't think that's a good idea, it does nothing for the readability and isn't idiomatic.

maintainer Applied
#3 lore raw
In reply to Dan Carpenter
Quoted 2 lines · Dan Carpenter

The missing break here means that we always return early and the function is a no-op.

Applied, thanks.