Skip to content

Commit 84117da

Browse files
Fabian Fredericktorvalds
authored andcommitted
kernel/cpu.c: convert printk to pr_foo()
no level printk converted to pr_warn (if err) no level printk converted to pr_info (disabling non-boot cpus) Other printk converted to respective level. Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 2c0d259 commit 84117da

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

‎kernel/cpu.c‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ static inline void check_for_tasks(int cpu)
283283
task_cputime(p, &utime, &stime);
284284
if (task_cpu(p) == cpu && p->state == TASK_RUNNING &&
285285
(utime || stime))
286-
printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d "
287-
"(state = %ld, flags = %x)\n",
286+
pr_warn("Task %s (pid = %d) is on cpu %d (state = %ld, flags = %x)\n",
288287
p->comm, task_pid_nr(p), cpu,
289288
p->state, p->flags);
290289
}
@@ -336,8 +335,8 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
336335
if (err) {
337336
nr_calls--;
338337
__cpu_notify(CPU_DOWN_FAILED | mod, hcpu, nr_calls, NULL);
339-
printk("%s: attempt to take down CPU %u failed\n",
340-
__func__, cpu);
338+
pr_warn("%s: attempt to take down CPU %u failed\n",
339+
__func__, cpu);
341340
goto out_release;
342341
}
343342

@@ -444,8 +443,8 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen)
444443
ret = __cpu_notify(CPU_UP_PREPARE | mod, hcpu, -1, &nr_calls);
445444
if (ret) {
446445
nr_calls--;
447-
printk(KERN_WARNING "%s: attempt to bring up CPU %u failed\n",
448-
__func__, cpu);
446+
pr_warn("%s: attempt to bring up CPU %u failed\n",
447+
__func__, cpu);
449448
goto out_notify;
450449
}
451450

@@ -475,11 +474,10 @@ int cpu_up(unsigned int cpu)
475474
int err = 0;
476475

477476
if (!cpu_possible(cpu)) {
478-
printk(KERN_ERR "can't online cpu %d because it is not "
479-
"configured as may-hotadd at boot time\n", cpu);
477+
pr_err("can't online cpu %d because it is not configured as may-hotadd at boot time\n",
478+
cpu);
480479
#if defined(CONFIG_IA64)
481-
printk(KERN_ERR "please check additional_cpus= boot "
482-
"parameter\n");
480+
pr_err("please check additional_cpus= boot parameter\n");
483481
#endif
484482
return -EINVAL;
485483
}
@@ -518,16 +516,15 @@ int disable_nonboot_cpus(void)
518516
*/
519517
cpumask_clear(frozen_cpus);
520518

521-
printk("Disabling non-boot CPUs ...\n");
519+
pr_info("Disabling non-boot CPUs ...\n");
522520
for_each_online_cpu(cpu) {
523521
if (cpu == first_cpu)
524522
continue;
525523
error = _cpu_down(cpu, 1);
526524
if (!error)
527525
cpumask_set_cpu(cpu, frozen_cpus);
528526
else {
529-
printk(KERN_ERR "Error taking CPU%d down: %d\n",
530-
cpu, error);
527+
pr_err("Error taking CPU%d down: %d\n", cpu, error);
531528
break;
532529
}
533530
}
@@ -537,7 +534,7 @@ int disable_nonboot_cpus(void)
537534
/* Make sure the CPUs won't be enabled by someone else */
538535
cpu_hotplug_disabled = 1;
539536
} else {
540-
printk(KERN_ERR "Non-boot CPUs are not disabled\n");
537+
pr_err("Non-boot CPUs are not disabled\n");
541538
}
542539
cpu_maps_update_done();
543540
return error;
@@ -561,17 +558,17 @@ void __ref enable_nonboot_cpus(void)
561558
if (cpumask_empty(frozen_cpus))
562559
goto out;
563560

564-
printk(KERN_INFO "Enabling non-boot CPUs ...\n");
561+
pr_info("Enabling non-boot CPUs ...\n");
565562

566563
arch_enable_nonboot_cpus_begin();
567564

568565
for_each_cpu(cpu, frozen_cpus) {
569566
error = _cpu_up(cpu, 1);
570567
if (!error) {
571-
printk(KERN_INFO "CPU%d is up\n", cpu);
568+
pr_info("CPU%d is up\n", cpu);
572569
continue;
573570
}
574-
printk(KERN_WARNING "Error taking CPU%d up: %d\n", cpu, error);
571+
pr_warn("Error taking CPU%d up: %d\n", cpu, error);
575572
}
576573

577574
arch_enable_nonboot_cpus_end();

0 commit comments

Comments
 (0)