Merge remote-tracking branch 'ovl/misc' into work.misc
[cascardo/linux.git] / lib / iommu-helper.c
index c27e269..a816f3a 100644 (file)
@@ -29,8 +29,7 @@ again:
        index = bitmap_find_next_zero_area(map, size, start, nr, align_mask);
        if (index < size) {
                if (iommu_is_span_boundary(index, nr, shift, boundary_size)) {
-                       /* we could do more effectively */
-                       start = index + 1;
+                       start = ALIGN(shift + index, boundary_size) - shift;
                        goto again;
                }
                bitmap_set(map, index, nr);