mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
staging: comedi: rtd520: use DIV_ROUND_CLOSEST and DIV_ROUND_UP macros
Use the macros to clarify the divisor calculations. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
640da60317
commit
da6877732d
1 changed files with 2 additions and 2 deletions
|
|
@ -392,13 +392,13 @@ static int rtd_ns_to_timer_base(unsigned int *nanosec,
|
|||
switch (flags & CMDF_ROUND_MASK) {
|
||||
case CMDF_ROUND_NEAREST:
|
||||
default:
|
||||
divider = (*nanosec + base / 2) / base;
|
||||
divider = DIV_ROUND_CLOSEST(*nanosec, base);
|
||||
break;
|
||||
case CMDF_ROUND_DOWN:
|
||||
divider = (*nanosec) / base;
|
||||
break;
|
||||
case CMDF_ROUND_UP:
|
||||
divider = (*nanosec + base - 1) / base;
|
||||
divider = DIV_ROUND_UP(*nanosec, base);
|
||||
break;
|
||||
}
|
||||
if (divider < 2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue