diff options
author | Jack Steiner <steiner@sgi.com> | 2009-06-17 23:28:23 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 20:04:00 (GMT) |
commit | 3eac2e95d7bb92222e185e445eca1fe3f695050f (patch) | |
tree | 51edba7b926d3587dfa40646bf7b453f47d26dff /drivers/misc/sgi-gru/grufile.c | |
parent | 836ce679c0b5b5040164171afc33753396864b30 (diff) | |
download | linux-3eac2e95d7bb92222e185e445eca1fe3f695050f.tar.xz |
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/grufile.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufile.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/misc/sgi-gru/grufile.c b/drivers/misc/sgi-gru/grufile.c index 9e6da46..b1567ce 100644 --- a/drivers/misc/sgi-gru/grufile.c +++ b/drivers/misc/sgi-gru/grufile.c @@ -135,11 +135,9 @@ static int gru_create_new_context(unsigned long arg) if (copy_from_user(&req, (void __user *)arg, sizeof(req))) return -EFAULT; - if (req.data_segment_bytes == 0 || - req.data_segment_bytes > max_user_dsr_bytes) + if (req.data_segment_bytes > max_user_dsr_bytes) return -EINVAL; - if (!req.control_blocks || !req.maximum_thread_count || - req.control_blocks > max_user_cbrs) + if (req.control_blocks > max_user_cbrs || !req.maximum_thread_count) return -EINVAL; if (!(req.options & GRU_OPT_MISS_MASK)) |