]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - kernel/stop_machine.c
stop_machine: Move local variable closer to the usage site in cpu_stop_cpu_callback()
[net-next-2.6.git] / kernel / stop_machine.c
index ef51d1fcf5e6ddc818b5c85993801508e5ae9684..b4e7431e7c78996607ef0495d7cb50bc34621d2c 100644 (file)
@@ -294,7 +294,6 @@ static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,
        struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
        unsigned int cpu = (unsigned long)hcpu;
        struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
-       struct cpu_stop_work *work;
        struct task_struct *p;
 
        switch (action & ~CPU_TASKS_FROZEN) {
@@ -323,6 +322,9 @@ static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,
 #ifdef CONFIG_HOTPLUG_CPU
        case CPU_UP_CANCELED:
        case CPU_DEAD:
+       {
+               struct cpu_stop_work *work;
+
                /* kill the stopper */
                kthread_stop(stopper->thread);
                /* drain remaining works */
@@ -335,6 +337,7 @@ static int __cpuinit cpu_stop_cpu_callback(struct notifier_block *nfb,
                put_task_struct(stopper->thread);
                stopper->thread = NULL;
                break;
+       }
 #endif
        }