aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/iommu.c
diff options
context:
space:
mode:
authorJames Morris <jmorris@namei.org>2011-03-08 10:55:06 +1100
committerJames Morris <jmorris@namei.org>2011-03-08 10:55:06 +1100
commit1cc26bada9f6807814806db2f0d78792eecdac71 (patch)
tree5509b5139db04af6c13db0a580c84116a4a54039 /arch/sparc/kernel/iommu.c
parentTOMOYO: Fix memory leak upon file open. (diff)
parentMerge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 (diff)
downloadlinux-dev-1cc26bada9f6807814806db2f0d78792eecdac71.tar.xz
linux-dev-1cc26bada9f6807814806db2f0d78792eecdac71.zip
Merge branch 'master'; commit 'v2.6.38-rc7' into next
Diffstat (limited to '')
-rw-r--r--arch/sparc/kernel/iommu.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 47977a77f6c6..72509d0e34be 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -255,10 +255,9 @@ static inline iopte_t *alloc_npages(struct device *dev, struct iommu *iommu,
static int iommu_alloc_ctx(struct iommu *iommu)
{
int lowest = iommu->ctx_lowest_free;
- int sz = IOMMU_NUM_CTXS - lowest;
- int n = find_next_zero_bit(iommu->ctx_bitmap, sz, lowest);
+ int n = find_next_zero_bit(iommu->ctx_bitmap, IOMMU_NUM_CTXS, lowest);
- if (unlikely(n == sz)) {
+ if (unlikely(n == IOMMU_NUM_CTXS)) {
n = find_next_zero_bit(iommu->ctx_bitmap, lowest, 1);
if (unlikely(n == lowest)) {
printk(KERN_WARNING "IOMMU: Ran out of contexts.\n");