public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Eric Youngdale <ericy@cais.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] remove meaningless <0 comparison in binfmt_elf
Date: Tue, 7 Jun 2005 01:20:31 +0200	[thread overview]
Message-ID: <9a874849050606162048ee149f@mail.gmail.com> (raw)

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

'i' is clearly defined at the start of the function to be unsigned, so
comparing it to be less than zero is meaningless.
This patch removes the meaningless comparison.

Since I'm away from home I can't use my usual pine to send the email,
but have to use gmail, and I don't know how gmail will treat the
inline patch, so I'm also attaching it.


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

 fs/binfmt_elf.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.12-rc6-orig/fs/binfmt_elf.c	2005-06-07 00:07:40.000000000 +0200
+++ linux-2.6.12-rc6/fs/binfmt_elf.c	2005-06-07 01:12:37.000000000 +0200
@@ -1324,7 +1324,7 @@ static int fill_psinfo(struct elf_prpsin
 
 	i = p->state ? ffz(~p->state) + 1 : 0;
 	psinfo->pr_state = i;
-	psinfo->pr_sname = (i < 0 || i > 5) ? '.' : "RSDTZW"[i];
+	psinfo->pr_sname = i > 5 ? '.' : "RSDTZW"[i];
 	psinfo->pr_zomb = psinfo->pr_sname == 'Z';
 	psinfo->pr_nice = task_nice(p);
 	psinfo->pr_flag = p->flags;



-- 
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: binfmt_elf-unsigned-checked-for-less-than-zero.patch --]
[-- Type: text/x-patch, Size: 497 bytes --]

--- linux-2.6.12-rc6-orig/fs/binfmt_elf.c	2005-06-07 00:07:40.000000000 +0200
+++ linux-2.6.12-rc6/fs/binfmt_elf.c	2005-06-07 01:12:37.000000000 +0200
@@ -1324,7 +1324,7 @@ static int fill_psinfo(struct elf_prpsin
 
 	i = p->state ? ffz(~p->state) + 1 : 0;
 	psinfo->pr_state = i;
-	psinfo->pr_sname = (i < 0 || i > 5) ? '.' : "RSDTZW"[i];
+	psinfo->pr_sname = i > 5 ? '.' : "RSDTZW"[i];
 	psinfo->pr_zomb = psinfo->pr_sname == 'Z';
 	psinfo->pr_nice = task_nice(p);
 	psinfo->pr_flag = p->flags;

                 reply	other threads:[~2005-06-06 23:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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