sched/rt: Use schedule_preempt_disabled()
Thomas Gleixner [Mon, 21 Mar 2011 11:33:18 +0000 (12:33 +0100)]
Coccinelle based conversion.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-24swm5zut3h9c4a6s46x8rws@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>

28 files changed:
arch/arm/kernel/process.c
arch/avr32/kernel/process.c
arch/blackfin/kernel/process.c
arch/cris/kernel/process.c
arch/frv/kernel/process.c
arch/h8300/kernel/process.c
arch/ia64/kernel/process.c
arch/m32r/kernel/process.c
arch/m68k/kernel/process_mm.c
arch/m68k/kernel/process_no.c
arch/microblaze/kernel/process.c
arch/mips/kernel/process.c
arch/mn10300/kernel/process.c
arch/parisc/kernel/process.c
arch/powerpc/kernel/idle.c
arch/powerpc/platforms/iseries/setup.c
arch/s390/kernel/process.c
arch/score/kernel/process.c
arch/sh/kernel/idle.c
arch/sparc/kernel/process_32.c
arch/sparc/kernel/process_64.c
arch/tile/kernel/process.c
arch/x86/kernel/process_32.c
arch/x86/kernel/process_64.c
arch/xtensa/kernel/process.c
init/main.c
kernel/mutex.c
kernel/softirq.c

index 971d65c..c2ae3cd 100644 (file)
@@ -239,9 +239,7 @@ void cpu_idle(void)
                leds_event(led_idle_end);
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index ea33957..92c5af9 100644 (file)
@@ -40,9 +40,7 @@ void cpu_idle(void)
                        cpu_idle_sleep();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 8dd0416..a80a643 100644 (file)
@@ -94,9 +94,7 @@ void cpu_idle(void)
                        idle();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index aa585e4..d8f50ff 100644 (file)
@@ -115,9 +115,7 @@ void cpu_idle (void)
                                idle = default_idle;
                        idle();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 3901df1..29cc497 100644 (file)
@@ -92,9 +92,7 @@ void cpu_idle(void)
                                idle();
                }
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 933bd38..1a173b3 100644 (file)
@@ -81,9 +81,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 6d33c5c..9dc52b6 100644 (file)
@@ -330,9 +330,7 @@ cpu_idle (void)
                        normal_xtp();
 #endif
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
                if (cpu_is_offline(cpu))
                        play_dead();
index 422bea9..3a4a32b 100644 (file)
@@ -90,9 +90,7 @@ void cpu_idle (void)
 
                        idle();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 099283e..fe4186b 100644 (file)
@@ -78,9 +78,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 5e1078c..f7fe6c3 100644 (file)
@@ -73,9 +73,7 @@ void cpu_idle(void)
        /* endless idle loop with no priority at all */
        while (1) {
                idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 7dcb5bf..9155f7d 100644 (file)
@@ -110,9 +110,7 @@ void cpu_idle(void)
                rcu_idle_exit();
                tick_nohz_idle_exit();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 7955409..61f1cb4 100644 (file)
@@ -80,9 +80,7 @@ void __noreturn cpu_idle(void)
 #endif
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 28eec31..cac401d 100644 (file)
@@ -123,9 +123,7 @@ void cpu_idle(void)
                        idle();
                }
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 62c60b8..d4b94b3 100644 (file)
@@ -71,9 +71,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        barrier();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 0a48bf5..6503514 100644 (file)
@@ -101,11 +101,11 @@ void cpu_idle(void)
                ppc64_runlatch_on();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               if (cpu_should_die())
+               if (cpu_should_die()) {
+                       preempt_enable_no_resched();
                        cpu_die();
-               schedule();
-               preempt_disable();
+               }
+               schedule_preempt_disabled();
        }
 }
 
index 8fc6258..a5fbf4c 100644 (file)
@@ -584,9 +584,7 @@ static void iseries_shared_idle(void)
                if (hvlpevent_is_pending())
                        process_iSeries_events();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
@@ -615,9 +613,7 @@ static void iseries_dedicated_idle(void)
                ppc64_runlatch_on();
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index e795933..7618085 100644 (file)
@@ -97,9 +97,7 @@ void cpu_idle(void)
                tick_nohz_idle_exit();
                if (test_thread_flag(TIF_MCCK_PENDING))
                        s390_handle_mcck();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 25d0803..2707023 100644 (file)
@@ -53,9 +53,7 @@ void __noreturn cpu_idle(void)
                while (!need_resched())
                        barrier();
 
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 406508d..7e48928 100644 (file)
@@ -114,9 +114,7 @@ void cpu_idle(void)
 
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index f793742..935fdbc 100644 (file)
@@ -113,9 +113,7 @@ void cpu_idle(void)
                        while (!need_resched())
                                cpu_relax();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
@@ -138,9 +136,7 @@ void cpu_idle(void)
                        while (!need_resched())
                                cpu_relax();
                }
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                check_pgt_cache();
        }
 }
index 39d8b05..ab9a292 100644 (file)
@@ -104,15 +104,13 @@ void cpu_idle(void)
                rcu_idle_exit();
                tick_nohz_idle_exit();
 
-               preempt_enable_no_resched();
-
 #ifdef CONFIG_HOTPLUG_CPU
-               if (cpu_is_offline(cpu))
+               if (cpu_is_offline(cpu)) {
+                       preempt_enable_no_resched();
                        cpu_play_dead();
+               }
 #endif
-
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 4c1ac6e..6ae495e 100644 (file)
@@ -108,9 +108,7 @@ void cpu_idle(void)
                }
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index c08d1ff..49888fe 100644 (file)
@@ -119,9 +119,7 @@ void cpu_idle(void)
                }
                rcu_idle_exit();
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index cfa5c90..e34257c 100644 (file)
@@ -156,9 +156,7 @@ void cpu_idle(void)
                }
 
                tick_nohz_idle_exit();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index 47041e7..2c90047 100644 (file)
@@ -113,9 +113,7 @@ void cpu_idle(void)
        while (1) {
                while (!need_resched())
                        platform_idle();
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
        }
 }
 
index ff49a6d..4990f7e 100644 (file)
@@ -374,11 +374,8 @@ static noinline void __init_refok rest_init(void)
         * at least once to get things moving:
         */
        init_idle_bootup_task(current);
-       preempt_enable_no_resched();
-       schedule();
-
+       schedule_preempt_disabled();
        /* Call into cpu_idle with preempt disabled */
-       preempt_disable();
        cpu_idle();
 }
 
index 89096dd..a307cc9 100644 (file)
@@ -240,9 +240,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 
                /* didn't get the lock, go to sleep: */
                spin_unlock_mutex(&lock->wait_lock, flags);
-               preempt_enable_no_resched();
-               schedule();
-               preempt_disable();
+               schedule_preempt_disabled();
                spin_lock_mutex(&lock->wait_lock, flags);
        }
 
index 4eb3a0f..79b5247 100644 (file)
@@ -744,9 +744,7 @@ static int run_ksoftirqd(void * __bind_cpu)
        while (!kthread_should_stop()) {
                preempt_disable();
                if (!local_softirq_pending()) {
-                       preempt_enable_no_resched();
-                       schedule();
-                       preempt_disable();
+                       schedule_preempt_disabled();
                }
 
                __set_current_state(TASK_RUNNING);