* [PATCH] ASoC: adau1977: Fix truncation warning on 64 bit architectures
@ 2014-08-01 16:19 Mark Brown
2014-08-04 7:15 ` Lars-Peter Clausen
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2014-08-01 16:19 UTC (permalink / raw)
To: Lars-Peter Clausen, Liam Girdwood; +Cc: alsa-devel, linaro-kernel, Mark Brown
From: Mark Brown <broonie@linaro.org>
Negating ADAU1977_BLOCK_POWER_SAI_LDO_EN creates an unsigned long constant
with all bits set which on 64 bit architectures needs to be truncated to
an unsigned int, generating a warning. Add an explicit cast since we know
this is OK.
Signed-off-by: Mark Brown <broonie@linaro.org>
---
sound/soc/codecs/adau1977.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c
index fd55da7..70ab357 100644
--- a/sound/soc/codecs/adau1977.c
+++ b/sound/soc/codecs/adau1977.c
@@ -968,7 +968,7 @@ int adau1977_probe(struct device *dev, struct regmap *regmap,
if (adau1977->dvdd_reg)
power_off_mask = ~0;
else
- power_off_mask = ~ADAU1977_BLOCK_POWER_SAI_LDO_EN;
+ power_off_mask = (unsigned int)~ADAU1977_BLOCK_POWER_SAI_LDO_EN;
ret = regmap_update_bits(adau1977->regmap, ADAU1977_REG_BLOCK_POWER_SAI,
power_off_mask, 0x00);
--
2.0.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: adau1977: Fix truncation warning on 64 bit architectures
2014-08-01 16:19 [PATCH] ASoC: adau1977: Fix truncation warning on 64 bit architectures Mark Brown
@ 2014-08-04 7:15 ` Lars-Peter Clausen
0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2014-08-04 7:15 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel, linaro-kernel, Mark Brown
On 08/01/2014 06:19 PM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
>
> Negating ADAU1977_BLOCK_POWER_SAI_LDO_EN creates an unsigned long constant
> with all bits set which on 64 bit architectures needs to be truncated to
> an unsigned int, generating a warning. Add an explicit cast since we know
> this is OK.
>
> Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Thanks.
> ---
> sound/soc/codecs/adau1977.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/adau1977.c b/sound/soc/codecs/adau1977.c
> index fd55da7..70ab357 100644
> --- a/sound/soc/codecs/adau1977.c
> +++ b/sound/soc/codecs/adau1977.c
> @@ -968,7 +968,7 @@ int adau1977_probe(struct device *dev, struct regmap *regmap,
> if (adau1977->dvdd_reg)
> power_off_mask = ~0;
> else
> - power_off_mask = ~ADAU1977_BLOCK_POWER_SAI_LDO_EN;
> + power_off_mask = (unsigned int)~ADAU1977_BLOCK_POWER_SAI_LDO_EN;
>
> ret = regmap_update_bits(adau1977->regmap, ADAU1977_REG_BLOCK_POWER_SAI,
> power_off_mask, 0x00);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-08-04 7:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-01 16:19 [PATCH] ASoC: adau1977: Fix truncation warning on 64 bit architectures Mark Brown
2014-08-04 7:15 ` Lars-Peter Clausen
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).