X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=kernel%2Fdma%2Fswiotlb.c;h=394494a6b1f35cc7038a2c3ffa00d3984eedd334;hb=d069ed288ac74c24e2b1c294aa9445c80ed6c518;hp=50a0e9c45c39afd295a7f6ec01a156a5b767c13f;hpb=f94cb36e760d2a4d359ad64f5fafc62ca755fd72;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 50a0e9c..394494a 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -903,9 +903,7 @@ static inline phys_addr_t slot_addr(phys_addr_t start, phys_addr_t idx) */ static inline unsigned long get_max_slots(unsigned long boundary_mask) { - if (boundary_mask == ~0UL) - return 1UL << (BITS_PER_LONG - IO_TLB_SHIFT); - return nr_slots(boundary_mask + 1); + return (boundary_mask >> IO_TLB_SHIFT) + 1; } static unsigned int wrap_area_index(struct io_tlb_pool *mem, unsigned int index)