Re: [Intel-gfx] [PATCH v2 1/4] kernel.h: Implement DIV_ROUND_CLOSEST_ULL

2015-03-24 Thread Jeff Epler
[for just patch 1/4; I didn't look as closely at the others] Reviewed-by: Jeff Epler ...with one half of a caveat (rounded up?): Like most or all of the originals, and like DIV_ROUND_CLOSEST just above it in kernel.h, the new code gives an incorrect answer if the temporary overflo

Re: [Intel-gfx] [PATCH 1/4] kernel.h: Implement DIV_ROUND_CLOSEST_ULL

2015-03-23 Thread Jeff Epler
On Fri, Mar 20, 2015 at 11:14:40AM +, Javi Merino wrote: > +/* > + * Same as above but for u64 dividends. divisor must be a 32-bit > + * number. > + */ > +#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ > +{\ > + unsigned long long