-mm swsusp: fix highmem handling

From: Pavel Machek
Date: Mon Aug 09 2004 - 16:18:10 EST


Hi!

This fixes highmem handling, and adds some comments so that others do
not fall into the same trap I fallen in: code does not continue below
swsusp_arch_resume if things go okay.

Please apply,
Pavel

--- clean-mm/kernel/power/swsusp.c 2004-07-28 23:39:49.000000000 +0200
+++ linux-mm/kernel/power/swsusp.c 2004-08-09 11:54:04.000000000 +0200
@@ -870,8 +866,12 @@
local_irq_disable();
save_processor_state();
error = swsusp_arch_suspend();
+ /* Restore control flow magically appears here */
restore_processor_state();
local_irq_enable();
+#ifdef CONFIG_HIGHMEM
+ restore_highmem();
+#endif
return error;
}

@@ -890,8 +889,12 @@
{
int error;
local_irq_disable();
save_processor_state();
error = swsusp_arch_resume();
+ /* Code below is only ever reached in case of failure. Otherwise
+ * execution continues at place where swsusp_arch_suspend was called
+ */
+ BUG_ON(!error);
restore_processor_state();
local_irq_enable();
return error;



--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/