aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/sgi-gru/grumain.c
diff options
context:
space:
mode:
authorJack Steiner <steiner@sgi.com>2009-06-17 16:28:23 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-18 13:04:00 -0700
commit3eac2e95d7bb92222e185e445eca1fe3f695050f (patch)
tree51edba7b926d3587dfa40646bf7b453f47d26dff /drivers/misc/sgi-gru/grumain.c
parent836ce679c0b5b5040164171afc33753396864b30 (diff)
gru: support contexts with zero dsrs or cbrs
Support alocation of GRU contexts that contain zero DSR or CBR resources. Some instructions do not require DSR resources. Contexts without CBR resources are useful for diagnostics. Signed-off-by: Jack Steiner <steiner@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grumain.c')
-rw-r--r--drivers/misc/sgi-gru/grumain.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/sgi-gru/grumain.c b/drivers/misc/sgi-gru/grumain.c
index 3398e54a762..4e6e8c3554f 100644
--- a/drivers/misc/sgi-gru/grumain.c
+++ b/drivers/misc/sgi-gru/grumain.c
@@ -150,7 +150,7 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
unsigned long bits = 0;
int i;
- do {
+ while (n--) {
i = find_first_bit(p, mmax);
if (i == mmax)
BUG();
@@ -158,7 +158,7 @@ static unsigned long reserve_resources(unsigned long *p, int n, int mmax,
__set_bit(i, &bits);
if (idx)
*idx++ = i;
- } while (--n);
+ }
return bits;
}