[PATCH 12/15] driver/staging/android: Use RLIMIT_TO_NICE to replace opened code implementation.
From: Dongsheng Yang
Date: Tue Mar 11 2014 - 01:03:47 EST
There is a macro RLINIT_TO_NICE in linux/sched/prio.h to convert priority in rlimit
to nice value.
This patch replace the opened implementation with RLINIT_TO_NICE.
Signed-off-by: Dongsheng Yang <yangds.fnst@xxxxxxxxxxxxxx>
cc: devel@xxxxxxxxxxxxxxxxxxxx
cc: Masanari Iida <standby24x7@xxxxxxxxx>
cc: Bojan Prtvar <prtvar.b@xxxxxxxxx>
cc: Serban Constantinescu <serban.constantinescu@xxxxxxx>
---
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..0cf5a49 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/