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, 20 Jul 2015 19:57:18 +0200
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Guenter Roeck <linux@...ck-us.net>
Cc:	Sowmini Varadhan <sowmini.varadhan@...cle.com>,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	benh@...nel.crashing.org, davem@...emloft.net
Subject: Re: [PATCH] iommu-common: Do not use 64 bit  constant 0xffffffffffffffffl for computing align_mask

On Mon, Jul 20 2015, Guenter Roeck <linux@...ck-us.net> wrote:

> So either case ~0l appears to be wrong; it should be ~0ul.

Yes, right-shifting -1 of any type is probably always wrong, as it will
always give -1 again. Probably one should add a smatch/sparse warning
for that.

> I don't know if ~0ull makes a difference for some architectures.

I highly doubt it. The result is truncated to unsigned long
anyway. Assuming align_order always has a value between 0 and
BITS_PER_LONG, GENMASK should be exactly what is wanted.

Rasmus
--
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