The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Remove unneeded code in sys_getpriority
Date: Sun, 3 Feb 2008 08:34:29 +0530	[thread overview]
Message-ID: <20080203030429.GB7459@ubuntu> (raw)

This check is not required because the condition is always true.

Signed-off-by: Rabin Vincent <rabin@rab.in>
---
 kernel/sys.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index d1fe71e..a001974 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -212,11 +212,8 @@ asmlinkage long sys_getpriority(int which, int who)
 				p = find_task_by_vpid(who);
 			else
 				p = current;
-			if (p) {
-				niceval = 20 - task_nice(p);
-				if (niceval > retval)
-					retval = niceval;
-			}
+			if (p)
+				retval = 20 - task_nice(p);
 			break;
 		case PRIO_PGRP:
 			if (who)
-- 
1.5.3.8


             reply	other threads:[~2008-02-03  3:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-03  3:04 Rabin Vincent [this message]
2008-02-03  9:54 ` [PATCH] Remove unneeded code in sys_getpriority Frank Seidel
2008-02-03 17:58   ` Rabin Vincent
2008-02-03 18:10     ` Frank Seidel

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=20080203030429.GB7459@ubuntu \
    --to=rabin@rab.in \
    --cc=akpm@linux-foundation.org \
    --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