Re: [PATCH 2/7] iommu/iova: cut down judgement times

2017-03-30 Thread Leizhen (ThunderTown)
On 2017/3/23 20:11, Robin Murphy wrote: > On 22/03/17 06:27, Zhen Lei wrote: >> Below judgement can only be satisfied at the last time, which produced 2N >> judgements(suppose N times failed, 0 or 1 time successed) in vain. >> >> if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { >>

Re: [PATCH 2/7] iommu/iova: cut down judgement times

2017-03-30 Thread Leizhen (ThunderTown)
On 2017/3/23 20:11, Robin Murphy wrote: > On 22/03/17 06:27, Zhen Lei wrote: >> Below judgement can only be satisfied at the last time, which produced 2N >> judgements(suppose N times failed, 0 or 1 time successed) in vain. >> >> if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { >>

Re: [PATCH 2/7] iommu/iova: cut down judgement times

2017-03-23 Thread Robin Murphy
On 22/03/17 06:27, Zhen Lei wrote: > Below judgement can only be satisfied at the last time, which produced 2N > judgements(suppose N times failed, 0 or 1 time successed) in vain. > > if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { > return iova; > } For me, GCC (6.2.1 AArch64) seems

Re: [PATCH 2/7] iommu/iova: cut down judgement times

2017-03-23 Thread Robin Murphy
On 22/03/17 06:27, Zhen Lei wrote: > Below judgement can only be satisfied at the last time, which produced 2N > judgements(suppose N times failed, 0 or 1 time successed) in vain. > > if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { > return iova; > } For me, GCC (6.2.1 AArch64) seems

[PATCH 2/7] iommu/iova: cut down judgement times

2017-03-22 Thread Zhen Lei
Below judgement can only be satisfied at the last time, which produced 2N judgements(suppose N times failed, 0 or 1 time successed) in vain. if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { return iova; } Signed-off-by: Zhen Lei --- drivers/iommu/iova.c

[PATCH 2/7] iommu/iova: cut down judgement times

2017-03-22 Thread Zhen Lei
Below judgement can only be satisfied at the last time, which produced 2N judgements(suppose N times failed, 0 or 1 time successed) in vain. if ((pfn >= iova->pfn_lo) && (pfn <= iova->pfn_hi)) { return iova; } Signed-off-by: Zhen Lei --- drivers/iommu/iova.c | 9 +++-- 1 file