lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <200611020017.58897.jesper.juhl@gmail.com>
Date:	Thu, 2 Nov 2006 00:17:58 +0100
From:	Jesper Juhl <jesper.juhl@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Gareth Hughes <gareth@...inux.com>,
	Linus Torvalds <torvalds@...l.org>,
	Jesper Juhl <jesper.juhl@...il.com>
Subject: [PATCH] remove pointless test of task == NULL from i386 dump_trace()

In arch/i386/kernel/traps.c::dump_trace() there's a line that reads
  if (task && task != current)
but at the start of the function we have
  if (!task)
  	task = current;
So 'task' will never be NULL (since 'current' will never be NULL unless 
I'm very much mistaken). Which renders the test of 'task == NULL' utter 
pointless.

Removing the check should provide a microscopic speedup due to a saved 
cycle or two and in addition it certainly does save a few bytes of .text 
for traps.o  :  

before:
   text    data     bss     dec     hex filename
  11887    2284      52   14223    378f arch/i386/kernel/traps.o
after:
   text    data     bss     dec     hex filename
  11871    2284      52   14207    377f arch/i386/kernel/traps.o


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

diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 00489b7..6355ce1 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -214,7 +214,7 @@ void dump_trace(struct task_struct *task
 	if (!stack) {
 		unsigned long dummy;
 		stack = &dummy;
-		if (task && task != current)
+		if (task != current)
 			stack = (unsigned long *)task->thread.esp;
 	}
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ