bject: 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 look
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)?
Joerg
On 06/24/2014 08:57 AM, Varun Sethi wrote:
> is_power_of_2 requires an unsigned long parameter which would
> lead to truncation of 64 bit values on 32 bit architectures.
>
> __ffs also expects an unsigned long parameter thus won't work
> for 64 bit values on 32 bit architectures.
>
> Signed-off-b
.org; alex.william...@redhat.com
> Subject: Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.
>
> On 06/24/2014 08:57 AM, Varun Sethi wrote:
> > is_power_of_2 requires an unsigned long parameter which would lead to
> > truncation of 64 bit values on 32 bit architectures.
is_power_of_2 requires an unsigned long parameter which would
lead to truncation of 64 bit values on 32 bit architectures.
__ffs also expects an unsigned long parameter thus won't work
for 64 bit values on 32 bit architectures.
Signed-off-by: Varun Sethi
---
drivers/iommu/fsl_pamu.c|