RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Varun Sethi
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

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Joerg Roedel
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 -- To

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Joerg Roedel
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 -- To

RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Varun Sethi
/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

RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-02 Thread Varun Sethi
.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.

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-02 Thread Emil Medve
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. > >

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-02 Thread Emil Medve
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-by:

RE: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-02 Thread Varun Sethi
...@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. __ffs also expects an unsigned long parameter thus

[PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-06-24 Thread Varun Sethi
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|

[PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-06-24 Thread Varun Sethi
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 varun.se...@freescale.com ---