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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 20, 2015 at 11:14:40AM +0000, 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 _tmp = (x) + (divisor) / 2;	\
> +	do_div(_tmp, divisor);				\
> +	_tmp;						\
> +}							\
> +)

The macro evaluates 'divisor' twice.

Jeff
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux