mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Gareth Hughes <gareth@valinux.com>,
	Linus Torvalds <torvalds@osdl.org>,
	Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH] remove pointless test of task == NULL from i386 dump_trace()
Date: Thu, 2 Nov 2006 00:17:58 +0100	[thread overview]
Message-ID: <200611020017.58897.jesper.juhl@gmail.com> (raw)

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@gmail.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;
 	}
 


                 reply	other threads:[~2006-11-01 23:16 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=200611020017.58897.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=gareth@valinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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

Powered by JetHome