diff options
| author | 2008-03-18 00:37:55 -0700 | |
|---|---|---|
| committer | 2008-03-18 00:37:55 -0700 | |
| commit | 577f99c1d08cf9cbdafd4e858dd13ff04d855090 (patch) | |
| tree | 0f726bbda9b18d311d4c95198bbd96cb7ac01db0 /lib/iommu-helper.c | |
| parent | iwlwifi: fix bug to show hidden APs during scan (diff) | |
| parent | Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 (diff) | |
| download | wireguard-linux-577f99c1d08cf9cbdafd4e858dd13ff04d855090.tar.xz wireguard-linux-577f99c1d08cf9cbdafd4e858dd13ff04d855090.zip | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/rt2x00/rt2x00dev.c
net/8021q/vlan_dev.c
Diffstat (limited to 'lib/iommu-helper.c')
| -rw-r--r-- | lib/iommu-helper.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/iommu-helper.c b/lib/iommu-helper.c index 495575a59ca6..a3b8d4c3f77a 100644 --- a/lib/iommu-helper.c +++ b/lib/iommu-helper.c @@ -40,10 +40,12 @@ static inline void set_bit_area(unsigned long *map, unsigned long i, } } -static inline int is_span_boundary(unsigned int index, unsigned int nr, - unsigned long shift, - unsigned long boundary_size) +int iommu_is_span_boundary(unsigned int index, unsigned int nr, + unsigned long shift, + unsigned long boundary_size) { + BUG_ON(!is_power_of_2(boundary_size)); + shift = (shift + index) & (boundary_size - 1); return shift + nr > boundary_size; } @@ -57,7 +59,7 @@ unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, again: index = find_next_zero_area(map, size, start, nr, align_mask); if (index != -1) { - if (is_span_boundary(index, nr, shift, boundary_size)) { + if (iommu_is_span_boundary(index, nr, shift, boundary_size)) { /* we could do more effectively */ start = index + 1; goto again; |
