On Tue, Oct 31, 2023 at 09:11:37AM +0200, Matti Vaittinen wrote: > On 10/30/23 12:21, Matti Vaittinen wrote: > > On 10/29/23 17:51, Matti Vaittinen wrote: > > > On 10/28/23 18:20, Jonathan Cameron wrote: ... > tmp = gts->max_scale; > > rem = do_div(tmp, total_gain); > if (total_gain > 1 && rem >= total_gain / 2) > tmp += 1ULL; ...which is NIH DIV_ROUND_CLOSEST_ULL() -- With Best Regards, Andy Shevchenko