[PATCH 01/17] ptrace: remove silly wait_trap variable from ptrace_attach()

From: Tejun Heo
Date: Sun May 29 2011 - 19:16:34 EST


Local variable wait_trap is used to determine whether to call
wait_event() on TRAPPING or not, which doesn't change or optimize
anything. Remove it.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
---
kernel/ptrace.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 2df1157..389497b 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -184,7 +184,6 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode)

static int ptrace_attach(struct task_struct *task)
{
- bool wait_trap = false;
int retval;

audit_ptrace(task);
@@ -246,7 +245,6 @@ static int ptrace_attach(struct task_struct *task)
if (task_is_stopped(task)) {
task->group_stop |= GROUP_STOP_PENDING | GROUP_STOP_TRAPPING;
signal_wake_up(task, 1);
- wait_trap = true;
}

spin_unlock(&task->sighand->siglock);
@@ -257,9 +255,8 @@ unlock_tasklist:
unlock_creds:
mutex_unlock(&task->signal->cred_guard_mutex);
out:
- if (wait_trap)
- wait_event(current->signal->wait_chldexit,
- !(task->group_stop & GROUP_STOP_TRAPPING));
+ wait_event(current->signal->wait_chldexit,
+ !(task->group_stop & GROUP_STOP_TRAPPING));
return retval;
}

--
1.7.5.2

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