Commit ca195b7f authored by Huang Ying's avatar Huang Ying Committed by Linus Torvalds

kexec jump: remove duplication of kexec_restart_prepare()

Call kernel_restart_prepare() in kernel_kexec() instead of duplicating the
code.
Signed-off-by: default avatarHuang Ying <ying.huang@intel.com>
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Acked-by: default avatarVivek 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fb45daa6
...@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *); ...@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *);
* Architecture independent implemenations of sys_reboot commands. * Architecture independent implemenations of sys_reboot commands.
*/ */
extern void kernel_restart_prepare(char *cmd);
extern void kernel_restart(char *cmd); extern void kernel_restart(char *cmd);
extern void kernel_halt(void); extern void kernel_halt(void);
extern void kernel_power_off(void); extern void kernel_power_off(void);
......
...@@ -1472,11 +1472,7 @@ int kernel_kexec(void) ...@@ -1472,11 +1472,7 @@ int kernel_kexec(void)
} else } else
#endif #endif
{ {
blocking_notifier_call_chain(&reboot_notifier_list, kernel_restart_prepare(NULL);
SYS_RESTART, NULL);
system_state = SYSTEM_RESTART;
device_shutdown();
sysdev_shutdown();
printk(KERN_EMERG "Starting new kernel\n"); printk(KERN_EMERG "Starting new kernel\n");
machine_shutdown(); machine_shutdown();
} }
......
...@@ -274,7 +274,7 @@ void emergency_restart(void) ...@@ -274,7 +274,7 @@ void emergency_restart(void)
} }
EXPORT_SYMBOL_GPL(emergency_restart); EXPORT_SYMBOL_GPL(emergency_restart);
static void kernel_restart_prepare(char *cmd) void kernel_restart_prepare(char *cmd)
{ {
blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd); blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
system_state = SYSTEM_RESTART; system_state = SYSTEM_RESTART;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment