divider = (nanosec) / devpriv->clock_ns;
break;
case CMDF_ROUND_UP:
- divider = (nanosec + devpriv->clock_ns - 1) / devpriv->clock_ns;
+ divider = DIV_ROUND_UP(nanosec, devpriv->clock_ns);
break;
}
return divider - 1;
break;
case CMDF_ROUND_UP:
up_count =
- (data[2] + devpriv->clock_ns -
- 1) / devpriv->clock_ns;
+ DIV_ROUND_UP(data[2], devpriv->clock_ns);
break;
default:
return -EINVAL;
break;
case CMDF_ROUND_UP:
down_count =
- (data[4] + devpriv->clock_ns -
- 1) / devpriv->clock_ns;
+ DIV_ROUND_UP(data[4], devpriv->clock_ns);
break;
default:
return -EINVAL;
break;
case CMDF_ROUND_UP:
up_count =
- (data[2] + devpriv->clock_ns -
- 1) / devpriv->clock_ns;
+ DIV_ROUND_UP(data[2], devpriv->clock_ns);
break;
default:
return -EINVAL;
break;
case CMDF_ROUND_UP:
down_count =
- (data[4] + devpriv->clock_ns -
- 1) / devpriv->clock_ns;
+ DIV_ROUND_UP(data[4], devpriv->clock_ns);
break;
default:
return -EINVAL;