lkml.org 
[lkml]   [2014]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 14/17] driver/staging/android: Use rlimit_to_nice to replace opened code implementation.
Date
There is a macro rlimit_to_nice in linux/sched/prio.h to convert priority in rlimit
to nice value.

This patch replace the opened implementation with rlimit_to_nice.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
cc: devel@driverdev.osuosl.org
cc: Masanari Iida <standby24x7@gmail.com>
cc: Bojan Prtvar <prtvar.b@gmail.com>
cc: Serban Constantinescu <serban.constantinescu@arm.com>
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
drivers/staging/android/binder.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
index 1432d95..19e844b 100644
--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -436,12 +436,12 @@ static void binder_set_nice(long nice)
set_user_nice(current, nice);
return;
}
- min_nice = 20 - current->signal->rlim[RLIMIT_NICE].rlim_cur;
+ min_nice = rlimit_to_nice(current->signal->rlim[RLIMIT_NICE].rlim_cur);
binder_debug(BINDER_DEBUG_PRIORITY_CAP,
"%d: nice value %ld not allowed use %ld instead\n",
current->pid, nice, min_nice);
set_user_nice(current, min_nice);
- if (min_nice < 20)
+ if (min_nice <= MAX_NICE)
return;
binder_user_error("%d RLIMIT_NICE not set\n", current->pid);
}
--
1.8.2.1


\
 
 \ /
  Last update: 2014-03-12 06:21    [W:0.260 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site