]> Pileus Git - ~andy/linux/blobdiff - kernel/power/main.c
[PATCH] Change the name of pagedir_nosave
[~andy/linux] / kernel / power / main.c
index cdf0f07af92f91dc58b1a441dcb66ff035b77db4..4d403323a7bb709c6384f7a5085f3cdb0872c360 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/init.h>
 #include <linux/pm.h>
 #include <linux/console.h>
+#include <linux/cpu.h>
 
 #include "power.h"
 
@@ -51,7 +52,7 @@ void pm_set_ops(struct pm_ops * ops)
 
 static int suspend_prepare(suspend_state_t state)
 {
-       int error = 0;
+       int error;
        unsigned int free_pages;
 
        if (!pm_ops || !pm_ops->enter)
@@ -59,12 +60,9 @@ static int suspend_prepare(suspend_state_t state)
 
        pm_prepare_console();
 
-       disable_nonboot_cpus();
-
-       if (num_online_cpus() != 1) {
-               error = -EPERM;
+       error = disable_nonboot_cpus();
+       if (error)
                goto Enable_cpu;
-       }
 
        if (freeze_processes()) {
                error = -EAGAIN;
@@ -145,7 +143,7 @@ static void suspend_finish(suspend_state_t state)
 
 
 
-static char *pm_states[PM_SUSPEND_MAX] = {
+static const char * const pm_states[PM_SUSPEND_MAX] = {
        [PM_SUSPEND_STANDBY]    = "standby",
        [PM_SUSPEND_MEM]        = "mem",
 #ifdef CONFIG_SOFTWARE_SUSPEND
@@ -262,7 +260,7 @@ static ssize_t state_show(struct subsystem * subsys, char * buf)
 static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n)
 {
        suspend_state_t state = PM_SUSPEND_STANDBY;
-       char ** s;
+       const char * const *s;
        char *p;
        int error;
        int len;