lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 23 Mar 2015 07:34:04 -0500
From:	Jeff Epler <jepler@...ythonic.net>
To:	Javi Merino <javi.merino@....com>
Cc:	akpm@...ux-foundation.org, intel-gfx@...ts.freedesktop.org,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	Daniel Vetter <daniel.vetter@...el.com>,
	Jani Nikula <jani.nikula@...ux.intel.com>,
	David Airlie <airlied@...ux.ie>,
	"Darrick J. Wong" <djwong@...ibm.com>,
	Guenter Roeck <linux@...ck-us.net>
Subject: Re: [PATCH 1/4] kernel.h: Implement DIV_ROUND_CLOSEST_ULL

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ