From: tip-bot for Yafang Shao <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org,
dvlasenk@redhat.com, peterz@infradead.org, brgerst@gmail.com,
luto@amacapital.net, hpa@zytor.com, mingo@kernel.org,
laoar.shao@gmail.com, torvalds@linux-foundation.org,
bp@alien8.de
Subject: [tip:x86/cleanups] x86/process: Avoid unnecessary NULL check in get_wchan()
Date: Thu, 22 Nov 2018 02:15:39 -0800 [thread overview]
Message-ID: <tip-c382986fe178d02abdfcd6f4e7b9783c2922872c@git.kernel.org> (raw)
In-Reply-To: <1542798734-12532-1-git-send-email-laoar.shao@gmail.com>
Commit-ID: c382986fe178d02abdfcd6f4e7b9783c2922872c
Gitweb: https://git.kernel.org/tip/c382986fe178d02abdfcd6f4e7b9783c2922872c
Author: Yafang Shao <laoar.shao@gmail.com>
AuthorDate: Wed, 21 Nov 2018 19:12:14 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 22 Nov 2018 10:07:21 +0100
x86/process: Avoid unnecessary NULL check in get_wchan()
Task 'p' is always guaranteed to be non-NULL, because the only call
sites are in fs/proc/ which all guarantee a non-NULL task pointer.
[ mingo: Improved the changelog. ]
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1542798734-12532-1-git-send-email-laoar.shao@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 8a33d4ad9661..b7cb5348f37f 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -733,7 +733,7 @@ unsigned long get_wchan(struct task_struct *p)
unsigned long start, bottom, top, sp, fp, ip, ret = 0;
int count = 0;
- if (!p || p == current || p->state == TASK_RUNNING)
+ if (p == current || p->state == TASK_RUNNING)
return 0;
if (!try_get_task_stack(p))
next prev parent reply other threads:[~2018-11-22 10:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-21 11:12 [PATCH] arch/x86/kernel/process.c: avoid unnecessary NULL check in get_wchan Yafang Shao
2018-11-22 10:15 ` tip-bot for Yafang Shao [this message]
2018-11-23 7:03 ` [tip:x86/cleanups] x86/process: Avoid unnecessary NULL check in get_wchan() tip-bot for Yafang Shao
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=tip-c382986fe178d02abdfcd6f4e7b9783c2922872c@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=dvlasenk@redhat.com \
--cc=hpa@zytor.com \
--cc=laoar.shao@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.