lkml.org 
[lkml]   [2014]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.
Date


> -----Original Message-----
> From: Joerg Roedel [mailto:joro@8bytes.org]
> Sent: Friday, July 04, 2014 4:15 PM
> To: Sethi Varun-B16395
> Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org;
> linuxppc-dev@lists.ozlabs.org; alex.williamson@redhat.com
> Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.
>
> On Tue, Jun 24, 2014 at 07:27:15PM +0530, Varun Sethi wrote:
> > /* window size is 2^(WSE+1) bytes */
> > - return __ffs(addrspace_size) - 1;
> > + return fls64(addrspace_size) - 2;
>
> This looks bogus, why do you replace ffs (find-first-bit) by fls (find-
> last-bit)?
>
Address space size is always a power of 2. This change was required to handle address sizes > 32bit width on 32 bit architectures.

-Varun



\
 
 \ /
  Last update: 2014-07-04 15:41    [W:0.049 / U:28.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site