public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>
Subject: [PATHC] remove redundant variable in sys_prctl
Date: Tue, 9 Aug 2005 13:45:32 +0200	[thread overview]
Message-ID: <9a874849050809044575466fa1@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

The `sig' variable in kernel/sys.c::sys_prctl() is completely
redundant, we might as well get rid of it.
Patch below for review (also attached since gmail's webmail interface
will most certainly mangle the inline one).

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> 
---

--- linux-2.6.13-rc6/kernel/sys.c~      2005-08-09 13:35:40.000000000 +0200
+++ linux-2.6.13-rc6/kernel/sys.c       2005-08-09 13:35:40.000000000 +0200
@@ -1711,7 +1711,6 @@ asmlinkage long sys_prctl(int option, un
                          unsigned long arg4, unsigned long arg5)
 {
        long error;
-       int sig;

        error = security_task_prctl(option, arg2, arg3, arg4, arg5);
        if (error)
@@ -1719,12 +1718,11 @@ asmlinkage long sys_prctl(int option, un

        switch (option) {
                case PR_SET_PDEATHSIG:
-                       sig = arg2;
-                       if (!valid_signal(sig)) {
+                       if (!valid_signal(arg2)) {
                                error = -EINVAL;
                                break;
                        }
-                       current->pdeath_signal = sig;
+                       current->pdeath_signal = arg2;
                        break;
                case PR_GET_PDEATHSIG:
                        error = put_user(current->pdeath_signal, (int
__user *)arg2);



-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

[-- Attachment #2: sys_prctl.patch --]
[-- Type: application/octet-stream, Size: 812 bytes --]


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>


--- linux-2.6.13-rc6/kernel/sys.c~	2005-08-09 13:35:40.000000000 +0200
+++ linux-2.6.13-rc6/kernel/sys.c	2005-08-09 13:35:40.000000000 +0200
@@ -1711,7 +1711,6 @@ asmlinkage long sys_prctl(int option, un
 			  unsigned long arg4, unsigned long arg5)
 {
 	long error;
-	int sig;
 
 	error = security_task_prctl(option, arg2, arg3, arg4, arg5);
 	if (error)
@@ -1719,12 +1718,11 @@ asmlinkage long sys_prctl(int option, un
 
 	switch (option) {
 		case PR_SET_PDEATHSIG:
-			sig = arg2;
-			if (!valid_signal(sig)) {
+			if (!valid_signal(arg2)) {
 				error = -EINVAL;
 				break;
 			}
-			current->pdeath_signal = sig;
+			current->pdeath_signal = arg2;
 			break;
 		case PR_GET_PDEATHSIG:
 			error = put_user(current->pdeath_signal, (int __user *)arg2);

             reply	other threads:[~2005-08-09 11:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 11:45 Jesper Juhl [this message]
2005-08-09 13:40 ` [PATHC] remove redundant variable in sys_prctl Jesper Juhl

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=9a874849050809044575466fa1@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=akpm@osdl.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