aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kexec.c
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2008-08-15 03:40:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-15 11:35:42 -0400
commit7ade3fcc1fe2801336112027a884070c9ca451af (patch)
treeadd446bef1fc2ada030f1e749245075a6baa86a7 /kernel/kexec.c
parent4cd69b986ebf0f8da93f82ffbb89c032ee09c2e1 (diff)
kexec jump: clean up #ifdef and comments
Move if (kexec_image->preserve_context) { ... } into #ifdef CONFIG_KEXEC_JUMP to make code looks cleaner. Fix no longer correct comments of kernel_kexec(). Signed-off-by: Huang Ying <ying.huang@intel.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r--kernel/kexec.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c
index cf3797b76786..bfbbd120623c 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1426,11 +1426,9 @@ static int __init crash_save_vmcoreinfo_init(void)
1426 1426
1427module_init(crash_save_vmcoreinfo_init) 1427module_init(crash_save_vmcoreinfo_init)
1428 1428
1429/** 1429/*
1430 * kernel_kexec - reboot the system 1430 * Move into place and start executing a preloaded standalone
1431 * 1431 * executable. If nothing was preloaded return an error.
1432 * Move into place and start executing a preloaded standalone
1433 * executable. If nothing was preloaded return an error.
1434 */ 1432 */
1435int kernel_kexec(void) 1433int kernel_kexec(void)
1436{ 1434{
@@ -1443,8 +1441,8 @@ int kernel_kexec(void)
1443 goto Unlock; 1441 goto Unlock;
1444 } 1442 }
1445 1443
1446 if (kexec_image->preserve_context) {
1447#ifdef CONFIG_KEXEC_JUMP 1444#ifdef CONFIG_KEXEC_JUMP
1445 if (kexec_image->preserve_context) {
1448 mutex_lock(&pm_mutex); 1446 mutex_lock(&pm_mutex);
1449 pm_prepare_console(); 1447 pm_prepare_console();
1450 error = freeze_processes(); 1448 error = freeze_processes();
@@ -1471,8 +1469,9 @@ int kernel_kexec(void)
1471 if (error) 1469 if (error)
1472 goto Enable_irqs; 1470 goto Enable_irqs;
1473 save_processor_state(); 1471 save_processor_state();
1472 } else
1474#endif 1473#endif
1475 } else { 1474 {
1476 blocking_notifier_call_chain(&reboot_notifier_list, 1475 blocking_notifier_call_chain(&reboot_notifier_list,
1477 SYS_RESTART, NULL); 1476 SYS_RESTART, NULL);
1478 system_state = SYSTEM_RESTART; 1477 system_state = SYSTEM_RESTART;
@@ -1484,8 +1483,8 @@ int kernel_kexec(void)
1484 1483
1485 machine_kexec(kexec_image); 1484 machine_kexec(kexec_image);
1486 1485
1487 if (kexec_image->preserve_context) {
1488#ifdef CONFIG_KEXEC_JUMP 1486#ifdef CONFIG_KEXEC_JUMP
1487 if (kexec_image->preserve_context) {
1489 restore_processor_state(); 1488 restore_processor_state();
1490 device_power_up(PMSG_RESTORE); 1489 device_power_up(PMSG_RESTORE);
1491 Enable_irqs: 1490 Enable_irqs:
@@ -1499,8 +1498,8 @@ int kernel_kexec(void)
1499 Restore_console: 1498 Restore_console:
1500 pm_restore_console(); 1499 pm_restore_console();
1501 mutex_unlock(&pm_mutex); 1500 mutex_unlock(&pm_mutex);
1502#endif
1503 } 1501 }
1502#endif
1504 1503
1505 Unlock: 1504 Unlock:
1506 if (!xchg(&kexec_lock, 0)) 1505 if (!xchg(&kexec_lock, 0))