aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2007-05-11 01:22:53 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-11 11:29:35 -0400
commit3e88c553db938ad016026375f0545304b9030b42 (patch)
treebbf9f04dea6f70e6a93a7b26e13db4778c9f3221 /kernel
parent00b8fd236764e3d5bc1d30dc65e256e283de4c3d (diff)
use defines in sys_getpriority/sys_setpriority
Switch to the defines for these two checks, instead of hard coding the values. [akpm@linux-foundation.org: add missing include] Signed-off-by: Daniel Walker <dwalker@mvista.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sys.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index ec319bbb0bd4..df4c3a8f5df9 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -14,6 +14,7 @@
14#include <linux/prctl.h> 14#include <linux/prctl.h>
15#include <linux/highuid.h> 15#include <linux/highuid.h>
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/resource.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18#include <linux/kexec.h> 19#include <linux/kexec.h>
19#include <linux/workqueue.h> 20#include <linux/workqueue.h>
@@ -659,7 +660,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
659 int error = -EINVAL; 660 int error = -EINVAL;
660 struct pid *pgrp; 661 struct pid *pgrp;
661 662
662 if (which > 2 || which < 0) 663 if (which > PRIO_USER || which < PRIO_PROCESS)
663 goto out; 664 goto out;
664 665
665 /* normalize: avoid signed division (rounding problems) */ 666 /* normalize: avoid signed division (rounding problems) */
@@ -723,7 +724,7 @@ asmlinkage long sys_getpriority(int which, int who)
723 long niceval, retval = -ESRCH; 724 long niceval, retval = -ESRCH;
724 struct pid *pgrp; 725 struct pid *pgrp;
725 726
726 if (which > 2 || which < 0) 727 if (which > PRIO_USER || which < PRIO_PROCESS)
727 return -EINVAL; 728 return -EINVAL;
728 729
729 read_lock(&tasklist_lock); 730 read_lock(&tasklist_lock);