5959#include <asm/pgtable.h>
6060#include <asm/mmu_context.h>
6161
62- static void exit_mm (struct task_struct * tsk );
62+ static void exit_mm (struct task_struct * tsk );
6363
6464static void __unhash_process (struct task_struct * p , bool group_dead )
6565{
@@ -151,7 +151,7 @@ static void __exit_signal(struct task_struct *tsk)
151151 spin_unlock (& sighand -> siglock );
152152
153153 __cleanup_sighand (sighand );
154- clear_tsk_thread_flag (tsk ,TIF_SIGPENDING );
154+ clear_tsk_thread_flag (tsk , TIF_SIGPENDING );
155155 if (group_dead ) {
156156 flush_sigqueue (& sig -> shared_pending );
157157 tty_kref_put (tty );
@@ -168,7 +168,7 @@ static void delayed_put_task_struct(struct rcu_head *rhp)
168168}
169169
170170
171- void release_task (struct task_struct * p )
171+ void release_task (struct task_struct * p )
172172{
173173 struct task_struct * leader ;
174174 int zap_leader ;
@@ -192,7 +192,8 @@ void release_task(struct task_struct * p)
192192 */
193193 zap_leader = 0 ;
194194 leader = p -> group_leader ;
195- if (leader != p && thread_group_empty (leader ) && leader -> exit_state == EXIT_ZOMBIE ) {
195+ if (leader != p && thread_group_empty (leader )
196+ && leader -> exit_state == EXIT_ZOMBIE ) {
196197 /*
197198 * If we were the last child thread and the leader has
198199 * exited already, and the leader's parent ignores SIGCHLD,
@@ -241,7 +242,8 @@ struct pid *session_of_pgrp(struct pid *pgrp)
241242 *
242243 * "I ask you, have you ever known what it is to be an orphan?"
243244 */
244- static int will_become_orphaned_pgrp (struct pid * pgrp , struct task_struct * ignored_task )
245+ static int will_become_orphaned_pgrp (struct pid * pgrp ,
246+ struct task_struct * ignored_task )
245247{
246248 struct task_struct * p ;
247249
@@ -294,9 +296,9 @@ kill_orphaned_pgrp(struct task_struct *tsk, struct task_struct *parent)
294296 struct task_struct * ignored_task = tsk ;
295297
296298 if (!parent )
297- /* exit: our father is in a different pgrp than
298- * we are and we were the only connection outside.
299- */
299+ /* exit: our father is in a different pgrp than
300+ * we are and we were the only connection outside.
301+ */
300302 parent = tsk -> real_parent ;
301303 else
302304 /* reparent: our child is in a different pgrp than
@@ -405,7 +407,7 @@ void mm_update_next_owner(struct mm_struct *mm)
405407 * Turn us into a lazy TLB process if we
406408 * aren't already..
407409 */
408- static void exit_mm (struct task_struct * tsk )
410+ static void exit_mm (struct task_struct * tsk )
409411{
410412 struct mm_struct * mm = tsk -> mm ;
411413 struct core_state * core_state ;
@@ -425,6 +427,7 @@ static void exit_mm(struct task_struct * tsk)
425427 core_state = mm -> core_state ;
426428 if (core_state ) {
427429 struct core_thread self ;
430+
428431 up_read (& mm -> mmap_sem );
429432
430433 self .task = tsk ;
@@ -566,6 +569,7 @@ static void forget_original_parent(struct task_struct *father)
566569
567570 list_for_each_entry_safe (p , n , & father -> children , sibling ) {
568571 struct task_struct * t = p ;
572+
569573 do {
570574 t -> real_parent = reaper ;
571575 if (t -> parent == father ) {
@@ -599,7 +603,7 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
599603 /*
600604 * This does two things:
601605 *
602- * A. Make init inherit all the child processes
606+ * A. Make init inherit all the child processes
603607 * B. Check to see if any process groups have become orphaned
604608 * as a result of our exiting, and if they have any stopped
605609 * jobs, send them a SIGHUP and then a SIGCONT. (POSIX 3.2.2.2)
@@ -649,9 +653,8 @@ static void check_stack_usage(void)
649653
650654 spin_lock (& low_water_lock );
651655 if (free < lowest_to_date ) {
652- printk (KERN_WARNING "%s (%d) used greatest stack depth: "
653- "%lu bytes left\n" ,
654- current -> comm , task_pid_nr (current ), free );
656+ pr_warn ("%s (%d) used greatest stack depth: %lu bytes left\n" ,
657+ current -> comm , task_pid_nr (current ), free );
655658 lowest_to_date = free ;
656659 }
657660 spin_unlock (& low_water_lock );
@@ -692,8 +695,7 @@ void do_exit(long code)
692695 * leave this task alone and wait for reboot.
693696 */
694697 if (unlikely (tsk -> flags & PF_EXITING )) {
695- printk (KERN_ALERT
696- "Fixing recursive fault but reboot is needed!\n" );
698+ pr_alert ("Fixing recursive fault but reboot is needed!\n" );
697699 /*
698700 * We can do this unlocked here. The futex code uses
699701 * this flag just to verify whether the pi state
@@ -717,9 +719,9 @@ void do_exit(long code)
717719 raw_spin_unlock_wait (& tsk -> pi_lock );
718720
719721 if (unlikely (in_atomic ()))
720- printk ( KERN_INFO "note: %s[%d] exited with preempt_count %d\n" ,
721- current -> comm , task_pid_nr (current ),
722- preempt_count ());
722+ pr_info ( "note: %s[%d] exited with preempt_count %d\n" ,
723+ current -> comm , task_pid_nr (current ),
724+ preempt_count ());
723725
724726 acct_update_integrals (tsk );
725727 /* sync mm's RSS info before statistics gathering */
@@ -837,7 +839,6 @@ void do_exit(long code)
837839 for (;;)
838840 cpu_relax (); /* For when BUG is null */
839841}
840-
841842EXPORT_SYMBOL_GPL (do_exit );
842843
843844void complete_and_exit (struct completion * comp , long code )
@@ -847,7 +848,6 @@ void complete_and_exit(struct completion *comp, long code)
847848
848849 do_exit (code );
849850}
850-
851851EXPORT_SYMBOL (complete_and_exit );
852852
853853SYSCALL_DEFINE1 (exit , int , error_code )
@@ -870,6 +870,7 @@ do_group_exit(int exit_code)
870870 exit_code = sig -> group_exit_code ;
871871 else if (!thread_group_empty (current )) {
872872 struct sighand_struct * const sighand = current -> sighand ;
873+
873874 spin_lock_irq (& sighand -> siglock );
874875 if (signal_group_exit (sig ))
875876 /* 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)
10341035 * as other threads in the parent group can be right
10351036 * here reaping other children at the same time.
10361037 *
1037- * We use thread_group_cputime_adjusted() to get times for the thread
1038- * group, which consolidates times for all threads in the
1039- * group including the group leader.
1038+ * We use thread_group_cputime_adjusted() to get times for
1039+ * the thread group, which consolidates times for all threads
1040+ * in the group including the group leader.
10401041 */
10411042 thread_group_cputime_adjusted (p , & tgutime , & tgstime );
10421043 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)
14181419
14191420 list_for_each_entry (p , & tsk -> children , sibling ) {
14201421 int ret = wait_consider_task (wo , 0 , p );
1422+
14211423 if (ret )
14221424 return ret ;
14231425 }
@@ -1431,6 +1433,7 @@ static int ptrace_do_wait(struct wait_opts *wo, struct task_struct *tsk)
14311433
14321434 list_for_each_entry (p , & tsk -> ptraced , ptrace_entry ) {
14331435 int ret = wait_consider_task (wo , 1 , p );
1436+
14341437 if (ret )
14351438 return ret ;
14361439 }
0 commit comments