Skip to content
Commit 9066bec6 authored by Matti Vaittinen's avatar Matti Vaittinen Committed by Sasha Levin
Browse files

iio: gts-helper: Fix division loop

[ Upstream commit bb76cc45

 ]

The loop based 64bit division may run for a long time when dividend is a
lot bigger than the divider. Replace the division loop by the
div64_u64() which implementation may be significantly faster.

Tested-by: default avatarSubhajit Ghosh <subhajit.ghosh@tweaklogic.com>
Signed-off-by: default avatarMatti Vaittinen <mazziesaccount@gmail.com>
Fixes: 38416c28

 ("iio: light: Add gain-time-scale helpers")
Link: https://lore.kernel.org/r/Zcn-6e-0-nh2WcfU@drtxq0yyyyyyyyyyyyyby-3.rev.dnainternet.fi
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 3328ff75
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment