sched/prio: Use DEFAULT_PRIO to define NICE_TO_PRIO() and PRIO_TO_NICE()
authorDongsheng Yang <yangds.fnst@cn.fujitsu.com>
Tue, 11 Feb 2014 07:34:45 +0000 (15:34 +0800)
committerIngo Molnar <mingo@kernel.org>
Sat, 22 Feb 2014 17:11:29 +0000 (18:11 +0100)
There is already a macro named DEFAULT_PRIO in prio.h, we can use it
to define NICE_TO_PRIO and PRIO_TO_NICE rather than use hard coding
of (MAX_RT_PRIO + 20).

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/4e28ec36fb49e8906027cbbdd900ab26a149905e.1392103744.git.yangds.fnst@cn.fujitsu.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/sched/prio.h

index 410ccb74c9e6893f28b96fb4f86e149e2e2ee378..1ceaaa1da3e4f65d50850e3436ffff9d99e495c2 100644 (file)
@@ -25,8 +25,8 @@
  * to static priority [ MAX_RT_PRIO..MAX_PRIO-1 ],
  * and back.
  */
-#define NICE_TO_PRIO(nice)     (MAX_RT_PRIO + (nice) + 20)
-#define PRIO_TO_NICE(prio)     ((prio) - MAX_RT_PRIO - 20)
+#define NICE_TO_PRIO(nice)     ((nice) + DEFAULT_PRIO)
+#define PRIO_TO_NICE(prio)     ((prio) - DEFAULT_PRIO)
 
 /*
  * 'User priority' is the nice value converted to something we
This page took 0.031773 seconds and 5 git commands to generate.