Commit a0be55de authored by Ionut Alexa's avatar Ionut Alexa Committed by Linus Torvalds

kernel/exit.c: fix coding style warnings and errors

Fixed coding style warnings and errors.
Signed-off-by: default avatarIonut Alexa <ionut.m.alexa@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f58d6c75
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
static void exit_mm(struct task_struct * tsk); static void exit_mm(struct task_struct *tsk);
static void __unhash_process(struct task_struct *p, bool group_dead) static void __unhash_process(struct task_struct *p, bool group_dead)
{ {
...@@ -151,7 +151,7 @@ static void __exit_signal(struct task_struct *tsk) ...@@ -151,7 +151,7 @@ static void __exit_signal(struct task_struct *tsk)
spin_unlock(&sighand->siglock); spin_unlock(&sighand->siglock);
__cleanup_sighand(sighand); __cleanup_sighand(sighand);
clear_tsk_thread_flag(tsk,TIF_SIGPENDING); clear_tsk_thread_flag(tsk, TIF_SIGPENDING);
if (group_dead) { if (group_dead) {
flush_sigqueue(&sig->shared_pending); flush_sigqueue(&sig->shared_pending);
tty_kref_put(tty); tty_kref_put(tty);
...@@ -168,7 +168,7 @@ static void delayed_put_task_struct(struct rcu_head *rhp) ...@@ -168,7 +168,7 @@ static void delayed_put_task_struct(struct rcu_head *rhp)
} }
void release_task(struct task_struct * p) void release_task(struct task_struct *p)
{ {
struct task_struct *leader; struct task_struct *leader;
int zap_leader; int zap_leader;
...@@ -192,7 +192,8 @@ void release_task(struct task_struct * p) ...@@ -192,7 +192,8 @@ void release_task(struct task_struct * p)
*/ */
zap_leader = 0; zap_leader = 0;
leader = p->group_leader; leader = p->group_leader;
if (leader != p && thread_group_empty(leader) && leader->exit_state == EXIT_ZOMBIE) { if (leader != p && thread_group_empty(leader)
&& leader->exit_state == EXIT_ZOMBIE) {
/* /*
* If we were the last child thread and the leader has * If we were the last child thread and the leader has
* exited already, and the leader's parent ignores SIGCHLD, * exited already, and the leader's parent ignores SIGCHLD,
...@@ -241,7 +242,8 @@ struct pid *session_of_pgrp(struct pid *pgrp) ...@@ -241,7 +242,8 @@ struct pid *session_of_pgrp(struct pid *pgrp)
* *
* "I ask you, have you ever known what it is to be an orphan?" * "I ask you, have you ever known what it is to be an orphan?"
*/ */
static int will_become_orphaned_pgrp(struct pid *pgrp, struct task_struct *ignored_task) static int will_become_orphaned_pgrp(struct pid *pgrp,
struct task_struct *ignored_task)
{ {
struct task_struct *p; struct task_struct *p;
...@@ -294,9 +296,9 @@ kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent) ...@@ -294,9 +296,9 @@ kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent)
struct task_struct *ignored_task = tsk; struct task_struct *ignored_task = tsk;
if (!parent) if (!parent)
/* exit: our father is in a different pgrp than /* exit: our father is in a different pgrp than
* we are and we were the only connection outside. * we are and we were the only connection outside.
*/ */
parent = tsk->real_parent; parent = tsk->real_parent;
else else
/* reparent: our child is in a different pgrp than /* reparent: our child is in a different pgrp than
...@@ -405,7 +407,7 @@ void mm_update_next_owner(struct mm_struct *mm) ...@@ -405,7 +407,7 @@ void mm_update_next_owner(struct mm_struct *mm)
* Turn us into a lazy TLB process if we * Turn us into a lazy TLB process if we
* aren't already.. * aren't already..
*/ */
static void exit_mm(struct task_struct * tsk) static void exit_mm(struct task_struct *tsk)
{ {
struct mm_struct *mm = tsk->mm; struct mm_struct *mm = tsk->mm;
struct core_state *core_state; struct core_state *core_state;
...@@ -425,6 +427,7 @@ static void exit_mm(struct task_struct * tsk) ...@@ -425,6 +427,7 @@ static void exit_mm(struct task_struct * tsk)
core_state = mm->core_state; core_state = mm->core_state;
if (core_state) { if (core_state) {
struct core_thread self; struct core_thread self;
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
self.task = tsk; self.task = tsk;
...@@ -566,6 +569,7 @@ static void forget_original_parent(struct task_struct *father) ...@@ -566,6 +569,7 @@ static void forget_original_parent(struct task_struct *father)
list_for_each_entry_safe(p, n, &father->children, sibling) { list_for_each_entry_safe(p, n, &father->children, sibling) {
struct task_struct *t = p; struct task_struct *t = p;
do { do {
t->real_parent = reaper; t->real_parent = reaper;
if (t->parent == father) { if (t->parent == father) {
...@@ -599,7 +603,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead) ...@@ -599,7 +603,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
/* /*
* This does two things: * This does two things:
* *
* A. Make init inherit all the child processes * A. Make init inherit all the child processes
* B. Check to see if any process groups have become orphaned * B. Check to see if any process groups have become orphaned
* as a result of our exiting, and if they have any stopped * as a result of our exiting, and if they have any stopped
* jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2) * jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2)
...@@ -649,9 +653,8 @@ static void check_stack_usage(void) ...@@ -649,9 +653,8 @@ static void check_stack_usage(void)
spin_lock(&low_water_lock); spin_lock(&low_water_lock);
if (free < lowest_to_date) { if (free < lowest_to_date) {
printk(KERN_WARNING "%s (%d) used greatest stack depth: " pr_warn("%s (%d) used greatest stack depth: %lu bytes left\n",
"%lu bytes left\n", current->comm, task_pid_nr(current), free);
current->comm, task_pid_nr(current), free);
lowest_to_date = free; lowest_to_date = free;
} }
spin_unlock(&low_water_lock); spin_unlock(&low_water_lock);
...@@ -692,8 +695,7 @@ void do_exit(long code) ...@@ -692,8 +695,7 @@ void do_exit(long code)
* leave this task alone and wait for reboot. * leave this task alone and wait for reboot.
*/ */
if (unlikely(tsk->flags & PF_EXITING)) { if (unlikely(tsk->flags & PF_EXITING)) {
printk(KERN_ALERT pr_alert("Fixing recursive fault but reboot is needed!\n");
"Fixing recursive fault but reboot is needed!\n");
/* /*
* We can do this unlocked here. The futex code uses * We can do this unlocked here. The futex code uses
* this flag just to verify whether the pi state * this flag just to verify whether the pi state
...@@ -717,9 +719,9 @@ void do_exit(long code) ...@@ -717,9 +719,9 @@ void do_exit(long code)
raw_spin_unlock_wait(&tsk->pi_lock); raw_spin_unlock_wait(&tsk->pi_lock);
if (unlikely(in_atomic())) if (unlikely(in_atomic()))
printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", pr_info("note: %s[%d] exited with preempt_count %d\n",
current->comm, task_pid_nr(current), current->comm, task_pid_nr(current),
preempt_count()); preempt_count());
acct_update_integrals(tsk); acct_update_integrals(tsk);
/* sync mm's RSS info before statistics gathering */ /* sync mm's RSS info before statistics gathering */
...@@ -837,7 +839,6 @@ void do_exit(long code) ...@@ -837,7 +839,6 @@ void do_exit(long code)
for (;;) for (;;)
cpu_relax(); /* For when BUG is null */ cpu_relax(); /* For when BUG is null */
} }
EXPORT_SYMBOL_GPL(do_exit); EXPORT_SYMBOL_GPL(do_exit);
void complete_and_exit(struct completion *comp, long code) void complete_and_exit(struct completion *comp, long code)
...@@ -847,7 +848,6 @@ void complete_and_exit(struct completion *comp, long code) ...@@ -847,7 +848,6 @@ void complete_and_exit(struct completion *comp, long code)
do_exit(code); do_exit(code);
} }
EXPORT_SYMBOL(complete_and_exit); EXPORT_SYMBOL(complete_and_exit);
SYSCALL_DEFINE1(exit, int, error_code) SYSCALL_DEFINE1(exit, int, error_code)
...@@ -870,6 +870,7 @@ do_group_exit(int exit_code) ...@@ -870,6 +870,7 @@ do_group_exit(int exit_code)
exit_code = sig->group_exit_code; exit_code = sig->group_exit_code;
else if (!thread_group_empty(current)) { else if (!thread_group_empty(current)) {
struct sighand_struct *const sighand = current->sighand; struct sighand_struct *const sighand = current->sighand;
spin_lock_irq(&sighand->siglock); spin_lock_irq(&sighand->siglock);
if (signal_group_exit(sig)) if (signal_group_exit(sig))
/* Another thread got here before we took the lock. */ /* Another thread got here before we took the lock. */
...@@ -1034,9 +1035,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p) ...@@ -1034,9 +1035,9 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
* as other threads in the parent group can be right * as other threads in the parent group can be right
* here reaping other children at the same time. * here reaping other children at the same time.
* *
* We use thread_group_cputime_adjusted() to get times for the thread * We use thread_group_cputime_adjusted() to get times for
* group, which consolidates times for all threads in the * the thread group, which consolidates times for all threads
* group including the group leader. * in the group including the group leader.
*/ */
thread_group_cputime_adjusted(p, &tgutime, &tgstime); thread_group_cputime_adjusted(p, &tgutime, &tgstime);
spin_lock_irq(&p->real_parent->sighand->siglock); spin_lock_irq(&p->real_parent->sighand->siglock);
...@@ -1418,6 +1419,7 @@ static int do_wait_thread(struct wait_opts *wo, struct task_struct *tsk) ...@@ -1418,6 +1419,7 @@ static int do_wait_thread(struct wait_opts *wo, struct task_struct *tsk)
list_for_each_entry(p, &tsk->children, sibling) { list_for_each_entry(p, &tsk->children, sibling) {
int ret = wait_consider_task(wo, 0, p); int ret = wait_consider_task(wo, 0, p);
if (ret) if (ret)
return ret; return ret;
} }
...@@ -1431,6 +1433,7 @@ static int ptrace_do_wait(struct wait_opts *wo, struct task_struct *tsk) ...@@ -1431,6 +1433,7 @@ static int ptrace_do_wait(struct wait_opts *wo, struct task_struct *tsk)
list_for_each_entry(p, &tsk->ptraced, ptrace_entry) { list_for_each_entry(p, &tsk->ptraced, ptrace_entry) {
int ret = wait_consider_task(wo, 1, p); int ret = wait_consider_task(wo, 1, p);
if (ret) if (ret)
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment