lkml.org 
[lkml]   [2015]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] iommu-common: Do not use 64 bit constant 0xffffffffffffffffl for computing align_mask
Date
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


\
 
 \ /
  Last update: 2015-07-20 20:21    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog