kexec jump: remove duplication of kexec_restart_prepare()
Subsystems (3)
PATCH 3/6 kexec jump: remove duplication of kexec_restart_prepare()
Call kernel_restart_prepare() in kernel_kexec() instead of duplicating the code.
Signed-off-by Huang Ying <[email protected]>
--- include/linux/reboot.h | 1 + kernel/kexec.c | 6 +----- kernel/sys.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)
include/linux/reboot.h +1 -0
@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struc* Architecture independent implemenations of sys_reboot commands. */ +extern void kernel_restart_prepare (char *cmd);extern void kernel_restart (char *cmd);extern void kernel_halt (void );extern void kernel_power_off (void );
kernel/sys.c +1 -1
@@ -274,7 +274,7 @@ void emergency_restart(void) }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); system_state =SYSTEM_RESTART ;
kernel/kexec.c +1 -5
@@ -1472,11 +1472,7 @@ int kernel_kexec(void) } else#endif { -blocking_notifier_call_chain (&reboot_notifier_list, -SYS_RESTART ,NULL ); - system_state =SYSTEM_RESTART ; -device_shutdown (); -sysdev_shutdown (); +kernel_restart_prepare (NULL );printk (KERN_EMERG "Starting new kernel\n" );machine_shutdown (); }
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Quoted 4 lines
Call
kernel_restart_prepare()inkernel_kexec()instead of duplicating the code.Signed-off-by Huang Ying <[email protected]>
ACK.
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 37 lines · Huang Ying
Call
kernel_restart_prepare()inkernel_kexec()instead of duplicating the code.Signed-off-by Huang Ying <[email protected]>--- include/linux/reboot.h | 1 + kernel/kexec.c | 6 +----- kernel/sys.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-)include/linux/reboot.h +1
-0@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struc* Architecture independent implemenations of sys_reboot commands. */ +extern void kernel_restart_prepare (char *cmd);extern void kernel_restart (char *cmd);extern void kernel_halt (void );extern void kernel_power_off (void );kernel/sys.c +1
-1@@ -274,7 +274,7 @@ void emergency_restart(void) }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); system_state =SYSTEM_RESTART ;kernel/kexec.c +0
-0@@ -1472,11 +1472,7 @@ int kernel_kexec(void) } else#endif
kernel/kexec.c int kernel_kexec(void) · line 1478
Quoted 10 lines
kernel/kexec.c +1
-5{ -blocking_notifier_call_chain (&reboot_notifier_list, -SYS_RESTART ,NULL ); - system_state =SYSTEM_RESTART ; -device_shutdown (); -sysdev_shutdown (); +kernel_restart_prepare (NULL );printk (KERN_EMERG "Starting new kernel\n" );machine_shutdown (); }
Looks good to me.
Acked-by Vivek Goyal <[email protected]>
Thanks
Vivek
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec