summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/nau8825.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-07-04 16:28:28 +0200
committerMark Brown <broonie@kernel.org>2018-07-04 16:41:32 +0200
commitda13ed1d80fe6a4d95043aaf2e0aff292ade5708 (patch)
tree1adbddefd76aa07310cf0d778da45c816efa6b4d /sound/soc/codecs/nau8825.c
parentASoC: core: Allow topology to override machine driver FE DAI link config. (diff)
downloadlinux-da13ed1d80fe6a4d95043aaf2e0aff292ade5708.tar.xz
linux-da13ed1d80fe6a4d95043aaf2e0aff292ade5708.zip
ASoC: nau8825: use 64-bit arithmetic instead of 32-bit
Add suffix ULL to constant 256 in order to give the compiler complete information about the proper arithmetic to use. Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic: 256 * fs * 2 * mclk_src_scaling[i].param Addresses-Coverity-ID: 1339616 ("Unintentional integer overflow") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to '')
-rw-r--r--sound/soc/codecs/nau8825.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index dc6ea4987b7d..b9fed99d8b5e 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -2016,7 +2016,7 @@ static int nau8825_calc_fll_param(unsigned int fll_in, unsigned int fs,
fvco_max = 0;
fvco_sel = ARRAY_SIZE(mclk_src_scaling);
for (i = 0; i < ARRAY_SIZE(mclk_src_scaling); i++) {
- fvco = 256 * fs * 2 * mclk_src_scaling[i].param;
+ fvco = 256ULL * fs * 2 * mclk_src_scaling[i].param;
if (fvco > NAU_FVCO_MIN && fvco < NAU_FVCO_MAX &&
fvco_max < fvco) {
fvco_max = fvco;