提交 4d51985e 编写于 作者: M Michael Rodriguez 提交者: Linus Torvalds

kernel/cpu.c: fix many errors related to style.

Change the printk() calls to have the KERN_INFO/KERN_ERROR stuff, and
fixes other coding style errors.  Not _all_ of them are gone, though.

[akpm@linux-foundation.org: revert the bits I disagree with]
Signed-off-by: NMichael Rodriguez <dkingston02@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 34db18a0
...@@ -160,7 +160,6 @@ static void cpu_notify_nofail(unsigned long val, void *v) ...@@ -160,7 +160,6 @@ static void cpu_notify_nofail(unsigned long val, void *v)
{ {
BUG_ON(cpu_notify(val, v)); BUG_ON(cpu_notify(val, v));
} }
EXPORT_SYMBOL(register_cpu_notifier); EXPORT_SYMBOL(register_cpu_notifier);
void __ref unregister_cpu_notifier(struct notifier_block *nb) void __ref unregister_cpu_notifier(struct notifier_block *nb)
...@@ -205,7 +204,6 @@ static int __ref take_cpu_down(void *_param) ...@@ -205,7 +204,6 @@ static int __ref take_cpu_down(void *_param)
return err; return err;
cpu_notify(CPU_DYING | param->mod, param->hcpu); cpu_notify(CPU_DYING | param->mod, param->hcpu);
return 0; return 0;
} }
...@@ -227,6 +225,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) ...@@ -227,6 +225,7 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
return -EINVAL; return -EINVAL;
cpu_hotplug_begin(); cpu_hotplug_begin();
err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls); err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls);
if (err) { if (err) {
nr_calls--; nr_calls--;
...@@ -304,7 +303,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen) ...@@ -304,7 +303,7 @@ static int __cpuinit _cpu_up(unsigned int cpu, int tasks_frozen)
ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls); ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
if (ret) { if (ret) {
nr_calls--; nr_calls--;
printk("%s: attempt to bring up CPU %u failed\n", printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
__func__, cpu); __func__, cpu);
goto out_notify; goto out_notify;
} }
...@@ -450,14 +449,14 @@ void __ref enable_nonboot_cpus(void) ...@@ -450,14 +449,14 @@ void __ref enable_nonboot_cpus(void)
if (cpumask_empty(frozen_cpus)) if (cpumask_empty(frozen_cpus))
goto out; goto out;
printk("Enabling non-boot CPUs ...\n"); printk(KERN_INFO "Enabling non-boot CPUs ...\n");
arch_enable_nonboot_cpus_begin(); arch_enable_nonboot_cpus_begin();
for_each_cpu(cpu, frozen_cpus) { for_each_cpu(cpu, frozen_cpus) {
error = _cpu_up(cpu, 1); error = _cpu_up(cpu, 1);
if (!error) { if (!error) {
printk("CPU%d is up\n", cpu); printk(KERN_INFO "CPU%d is up\n", cpu);
continue; continue;
} }
printk(KERN_WARNING "Error taking CPU%d up: %d\n", cpu, error); printk(KERN_WARNING "Error taking CPU%d up: %d\n", cpu, error);
...@@ -509,7 +508,7 @@ void __cpuinit notify_cpu_starting(unsigned int cpu) ...@@ -509,7 +508,7 @@ void __cpuinit notify_cpu_starting(unsigned int cpu)
*/ */
/* cpu_bit_bitmap[0] is empty - so we can back into it */ /* cpu_bit_bitmap[0] is empty - so we can back into it */
#define MASK_DECLARE_1(x) [x+1][0] = 1UL << (x) #define MASK_DECLARE_1(x) [x+1][0] = (1UL << (x))
#define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1) #define MASK_DECLARE_2(x) MASK_DECLARE_1(x), MASK_DECLARE_1(x+1)
#define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2) #define MASK_DECLARE_4(x) MASK_DECLARE_2(x), MASK_DECLARE_2(x+2)
#define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4) #define MASK_DECLARE_8(x) MASK_DECLARE_4(x), MASK_DECLARE_4(x+4)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册