Skip to content
Commit 7fd6592d authored by Nikolaus Schulz's avatar Nikolaus Schulz Committed by Jonathan Cameron
Browse files

iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values



Fix formatting of negative values of type IIO_VAL_FRACTIONAL_LOG2 by
switching from do_div(), which can't handle negative numbers, to
div_s64_rem().  Also use shift_right for shifting, which is safe with
negative values.

Signed-off-by: default avatarNikolaus Schulz <nikolaus.schulz@avionic-design.de>
Reviewed-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 51f528a1
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