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

While GENMASK may do the job, the code is already quite obscure,
so I'm going to stick with the minimal delta to get this right,
namely

- align_mask = 0xffffffffffffffffl >> (64 - align_order);
+ align_mask = ~0ul >> (BITS_PER_LONG - align_order);

--Sowmini



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