Skip to contentSkip to conversation

remove meaningless <0 comparison in binfmt_elf

PATCH New Jesper Juhl 1 participant 1 message Jun 6, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove meaningless <0 comparison in binfmt_elf

'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.

---

 fs/binfmt_elf.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/binfmt_elf.c +1 -1
@@ -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;
Signature · 3 lines
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
fs/binfmt_elf.c +1 -1
@@ -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;