Skip to contentSkip to conversation

ASoC:lm49453: fix build warnings

PATCH Applied [email protected] 2 participants 2 messages Apr 5, 2012

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 ASoC:lm49453: fix build warnings

From: M R Swami Reddy <[email protected]>

sound/soc/codecs/lm49453.c: In function 'lm49453_set_dai_fmt':
sound/soc/codecs/lm49453.c:1189:4: warning: overflow in implicit constant conversion [-Woverflow] sound/soc/codecs/lm49453.c:1193:4: warning: overflow in implicit constant conversion [-Woverflow] sound/soc/codecs/lm49453.c:1197:4: warning: overflow in implicit constant conversion [-Woverflow]

---
 sound/soc/codecs/lm49453.c  |   13 +-
 1 file changed, 5 insertions(+), 8 deletions(-)
sound/soc/codecs/lm49453.c +5 -8
index 744063d..74409ec 100644
@@ -1178,27 +1178,24 @@ static int lm49453_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
 {
 	struct snd_soc_codec *codec = codec_dai->codec;
 
-	int aif_val = 0;
+	u16 aif_val;
 	int mode = 0;
 	int clk_phase = 0;
 	int clk_shift = 0;
 
 	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
 	case SND_SOC_DAIFMT_CBS_CFS:
-		aif_val = ~LM49453_AUDIO_PORT1_BASIC_CLK_MS |
-			~LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
+		aif_val = 0;
 		break;
 	case SND_SOC_DAIFMT_CBS_CFM:
-		aif_val = ~LM49453_AUDIO_PORT1_BASIC_CLK_MS |
-			LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
+		aif_val = LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
 		break;
 	case SND_SOC_DAIFMT_CBM_CFS:
-		aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS |
-			~LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
+		aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS;
 		break;
 	case SND_SOC_DAIFMT_CBM_CFM:
 		aif_val = LM49453_AUDIO_PORT1_BASIC_CLK_MS |
-			LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
+			  LM49453_AUDIO_PORT1_BASIC_SYNC_MS;
 		break;
 	default:
 		return -EINVAL;
Applied
#1 lore raw
Quoted 9 lines · On Thu, Apr 05, 2012 at 08:54:09PM +0530, [email protected] wrote:

From: M R Swami Reddy <[email protected]>

sound/soc/codecs/lm49453.c: In function 'lm49453_set_dai_fmt':
sound/soc/codecs/lm49453.c:1189:4: warning: overflow in implicit constant conversion [-Woverflow] sound/soc/codecs/lm49453.c:1193:4: warning: overflow in implicit constant conversion [-Woverflow] sound/soc/codecs/lm49453.c:1197:4: warning: overflow in implicit constant conversion [-Woverflow]

Applied, thanks, though I have to say the fix isn't terribly obvious.