diff options
| author | wangdicheng <wangdicheng@kylinos.cn> | 2026-07-17 17:15:42 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-07-18 01:22:48 +0100 |
| commit | a46ccc71877e962783e0fffa105e41615904c511 (patch) | |
| tree | a6c43c5d2140d2c9a8f75ae736a289eb84f9bb42 /tools/perf/scripts/python/bin | |
| parent | fcf2a365da23994f47af0f1203cf245d5e467b6a (diff) | |
ASoC: fsl_easrc: Use div64_u64 for 64-by-64 division
Fix a coccinelle warning about do_div() truncating a 64-bit divisor:
sound/soc/fsl/fsl_easrc.c:2061:2-8: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead.
In fsl_easrc_m2m_calc_out_len(), val1 is computed as:
val1 = (u64)in_rate << frac_bits; // frac_bits up to 39
do_div(val1, out_rate);
val1 += (s64)ctx_priv->ratio_mod << (frac_bits - 31);
val1 = val1 >> 12;
In the worst case (in_rate=384000, out_rate=8000, frac_bits=39):
val1 = 384000 << 39 / 8000 = 26,388,279,068,672
val1 >> 12 = 6,440,497,829 (33 bits, exceeds 32-bit range)
val1 is then used as the divisor in do_div(val2, val1), where
do_div() silently truncates it to 32 bits, producing incorrect
results. Use div64_u64() to perform a proper 64-by-64 division.
Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
Cc: stable@vger.kernel.org
Signed-off-by: wangdicheng <wangdicheng@kylinos.cn>
Link: https://patch.msgid.link/20260717091542.721877-4-wangdich9700@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
