From: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
To: <akpm@linux-foundation.org>, <gorcunov@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Subject: [PATCH] sys_prctl(): simplify arg2 judgment when calling PR_SET_TIMERSLACK
Date: Tue, 23 Jul 2019 11:30:53 +0800 [thread overview]
Message-ID: <1563852653-2382-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> (raw)
arg2 will never < 0, for its type is 'unsigned long'. So negative
judgment is meaningless.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
---
kernel/sys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/sys.c b/kernel/sys.c
index 2969304c29fe..399457d26bef 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2372,11 +2372,11 @@ SYSCALL_DEFINE5(prctl, int, option, unsigned long, arg2, unsigned long, arg3,
error = current->timer_slack_ns;
break;
case PR_SET_TIMERSLACK:
- if (arg2 <= 0)
+ if (arg2)
+ current->timer_slack_ns = arg2;
+ else
current->timer_slack_ns =
current->default_timer_slack_ns;
- else
- current->timer_slack_ns = arg2;
break;
case PR_MCE_KILL:
if (arg4 | arg5)
--
2.18.1
next reply other threads:[~2019-07-23 3:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-23 3:30 Yang Xu [this message]
2019-07-23 7:23 ` [PATCH] sys_prctl(): simplify arg2 judgment when calling PR_SET_TIMERSLACK Cyrill Gorcunov
2019-07-23 8:11 ` Yang Xu
2019-07-23 9:48 ` Cyrill Gorcunov
2019-07-24 2:11 ` [PATCH v2] sys_prctl(): remove unsigned comparision with less than zero Yang Xu
2019-07-24 6:56 ` Cyrill Gorcunov
2019-07-25 2:14 ` Andrew Morton
2019-07-25 3:10 ` Yang Xu
2019-07-30 8:48 ` Yang Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1563852653-2382-1-git-send-email-xuyang2018.jy@cn.fujitsu.com \
--to=xuyang2018.jy@cn.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=gorcunov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).