[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87oaj6ogox.fsf@rasmusvillemoes.dk>
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