[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4748d2da179215c9563d84a304c02e677eaa4222.1394529373.git.yangds.fnst@cn.fujitsu.com>
Date: Tue, 11 Mar 2014 17:20:34 +0800
From: Dongsheng Yang <yangds.fnst@...fujitsu.com>
To: linux-kernel@...r.kernel.org
Cc: joe@...ches.com, peterz@...radead.org, mingo@...nel.org,
tglx@...utronix.de, heiko.carstens@...ibm.com,
Dongsheng Yang <yangds.fnst@...fujitsu.com>,
devel@...verdev.osuosl.org, Masanari Iida <standby24x7@...il.com>,
Bojan Prtvar <prtvar.b@...il.com>,
Serban Constantinescu <serban.constantinescu@....com>
Subject: [PATCH 13/16] driver/staging/android: Use rlimit_to_nice to replace opened code implementation.
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@...fujitsu.com>
cc: devel@...verdev.osuosl.org
cc: Masanari Iida <standby24x7@...il.com>
cc: Bojan Prtvar <prtvar.b@...il.com>
cc: Serban Constantinescu <serban.constantinescu@....com>
Signed-off-by: Dongsheng Yang <yangds.fnst@...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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists