lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0261f094b836f1acbcdf52e7166487c0c77323c8.1392103744.git.yangds.fnst@cn.fujitsu.com>
Date:	Tue, 11 Feb 2014 15:34:51 +0800
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	linux-kernel@...r.kernel.org
Cc:	Dongsheng Yang <yangds.fnst@...fujitsu.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Oleg Nesterov <oleg@...hat.com>, Robin Holt <holt@....com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Kees Cook <keescook@...omium.org>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...nel.org>
Subject: [PATCH 7/9] sys: Replace hardcoding of -20 and 19 with MIN_NICE and MAX_NICE.

Signed-off-by: Dongsheng Yang <yangds.fnst@...fujitsu.com>
cc: Andrew Morton <akpm@...ux-foundation.org>
cc: Oleg Nesterov <oleg@...hat.com>
cc: Robin Holt <holt@....com>
cc: Al Viro <viro@...iv.linux.org.uk>
cc: Kees Cook <keescook@...omium.org>
cc: "Eric W. Biederman" <ebiederm@...ssion.com>
cc: Stephen Rothwell <sfr@...b.auug.org.au>
cc: Peter Zijlstra <peterz@...radead.org>
cc: Ingo Molnar <mingo@...nel.org>
---
 kernel/sys.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index c0a58be..adaeab6 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -174,10 +174,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval)
 
 	/* normalize: avoid signed division (rounding problems) */
 	error = -ESRCH;
-	if (niceval < -20)
-		niceval = -20;
-	if (niceval > 19)
-		niceval = 19;
+	if (niceval < MIN_NICE)
+		niceval = MIN_NICE;
+	if (niceval > MAX_NICE)
+		niceval = MAX_NICE;
 
 	rcu_read_lock();
 	read_lock(&tasklist_lock);
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ