arch/x86/kernel/process.c: avoid unnecessary NULL check in get_wchan
PATCH 1/1 arch/x86/kernel/process.c: avoid unnecessary NULL check in get_wchan
Because the task p is always guaranteed to be non-NULL.
Signed-off-by Yafang Shao <[email protected]>
--- arch/x86/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/process.c +1 -1
@@ -730,7 +730,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))
Signature · 1 line
1.8.3.1
tip-bot for Yafang Shao
merge bot[tip:x86/cleanups] x86/process: Avoid unnecessary NULL check in get_wchan()
x86/process: Avoid unnecessary NULL check in get_wchan()
Commit-ID: c382986fe178d02abdfcd6f4e7b9783c2922872c Gitweb: https://git.kernel.org/tip/c382986fe178d02abdfcd6f4e7b9783c2922872c Author: Yafang Shao <[email protected]> AuthorDate: Wed, 21 Nov 2018 19:12:14 +0800 Committer: Ingo Molnar <[email protected]> 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 <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/process.c +1 -1
@@ -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))
tip-bot for Yafang Shao
merge bot[tip:x86/cleanups] x86/process: Avoid unnecessary NULL check in get_wchan()
In reply to Yafang Shaox86/process: Avoid unnecessary NULL check in get_wchan()
Commit-ID: 6e662ae7bce6db602f79e57791f5fb887fb7d371 Gitweb: https://git.kernel.org/tip/6e662ae7bce6db602f79e57791f5fb887fb7d371 Author: Yafang Shao <[email protected]> AuthorDate: Wed, 21 Nov 2018 19:12:14 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Fri, 23 Nov 2018 07:58:23 +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 <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- arch/x86/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/process.c +1 -1
@@ -730,7 +730,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))