alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: adau1373: adau1373_hw_params: Silence overflow warning
@ 2013-03-10 17:34 Tim Gardner
  2013-03-11 10:01 ` Lars-Peter Clausen
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Gardner @ 2013-03-10 17:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Tim Gardner, Lars-Peter Clausen, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, device-drivers-devel, alsa-devel

ADAU1373_BCLKDIV_SOURCE is defined as BIT(5) which uses UL constants. On
amd64 the result of the ones complement operator is then truncated to
unsigned int according to the prototype of snd_soc_update_bits(). I think
gcc is correctly warning that the upper 32 bits are lost.

sound/soc/codecs/adau1373.c: In function 'adau1373_hw_params':
sound/soc/codecs/adau1373.c:940:3: warning: large integer implicitly truncated to unsigned type [-Woverflow]

gcc version 4.6.3

Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: device-drivers-devel@blackfin.uclinux.org
Cc: alsa-devel@alsa-project.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 sound/soc/codecs/adau1373.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c
index 068b3ae..56ed788 100644
--- a/sound/soc/codecs/adau1373.c
+++ b/sound/soc/codecs/adau1373.c
@@ -132,7 +132,7 @@ struct adau1373 {
 #define ADAU1373_DAI_FORMAT_I2S		0x2
 #define ADAU1373_DAI_FORMAT_DSP		0x3
 
-#define ADAU1373_BCLKDIV_SOURCE		BIT(5)
+#define ADAU1373_BCLKDIV_SOURCE		(unsigned int)BIT(5)
 #define ADAU1373_BCLKDIV_32		0x03
 #define ADAU1373_BCLKDIV_64		0x02
 #define ADAU1373_BCLKDIV_128		0x01
-- 
1.7.9.5

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

end of thread, other threads:[~2013-03-12 19:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-10 17:34 [PATCH] ASoC: adau1373: adau1373_hw_params: Silence overflow warning Tim Gardner
2013-03-11 10:01 ` Lars-Peter Clausen
2013-03-11 15:37   ` Tim Gardner
2013-03-11 18:55     ` Lars-Peter Clausen
2013-03-11 19:18       ` [PATCH linux-next v2] " Tim Gardner
2013-03-11 19:26         ` Lars-Peter Clausen
2013-03-12 18:47         ` Mark Brown
2013-03-12 19:17           ` Tim Gardner
2013-03-12 19:39             ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).