[PATCH] remove meaningless <0 comparison in binfmt_elf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'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 <[email protected]>
--- 

 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 <[email protected]>
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
--- 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;

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux