Messages in this thread |  | | From | Rasmus Villemoes <> | | Subject | Re: [PATCH] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask | | Date | Mon, 20 Jul 2015 19:57:18 +0200 |
| |
On Mon, Jul 20 2015, Guenter Roeck <linux@roeck-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
|  |