Skip to content
Commit 138daca3 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron
Browse files

iio: sc27xx_adc: Use DIV_ROUND_CLOSEST() instead of open-coding it



Use DIV_ROUND_CLOSEST() instead of open-coding it. This makes it more clear
what is going on for the casual reviewer.

Generated using the following the Coccinelle semantic patch.

// <smpl>
@@
expression x, y;
@@
-((x) + ((y) / 2)) / (y)
+DIV_ROUND_CLOSEST(x, y)
// </smpl>

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarChunyan Zhang <zhang.lyra@gmail.com>
Link: https://lore.kernel.org/r/20201222191618.3433-1-lars@metafoo.de


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent de8860b1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment