PM / Hibernate: Shift remaining code from swsusp.c to hibernate.c
authorNigel Cunningham <nigel@tuxonice.net>
Sun, 6 Dec 2009 15:16:07 +0000 (16:16 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 6 Dec 2009 15:16:07 +0000 (16:16 +0100)
Shift the remaining declaration of the variable in_suspend and the
function swsusp_show_speed from swsusp.c to hibernate.c, and delete
swsusp.c.

Signed-off-by: Nigel Cunningham <nigel@tuxonice.net>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
kernel/power/Makefile
kernel/power/hibernate.c
kernel/power/swsusp.c

index c3b81c3..4319181 100644 (file)
@@ -8,7 +8,7 @@ obj-$(CONFIG_PM_SLEEP)          += console.o
 obj-$(CONFIG_FREEZER)          += process.o
 obj-$(CONFIG_SUSPEND)          += suspend.o
 obj-$(CONFIG_PM_TEST_SUSPEND)  += suspend_test.o
 obj-$(CONFIG_FREEZER)          += process.o
 obj-$(CONFIG_SUSPEND)          += suspend.o
 obj-$(CONFIG_PM_TEST_SUSPEND)  += suspend_test.o
-obj-$(CONFIG_HIBERNATION)      += swsusp.o hibernate.o snapshot.o swap.o user.o
+obj-$(CONFIG_HIBERNATION)      += hibernate.o snapshot.o swap.o user.o
 obj-$(CONFIG_HIBERNATION_NVS)  += hibernate_nvs.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)      += poweroff.o
 obj-$(CONFIG_HIBERNATION_NVS)  += hibernate_nvs.o
 
 obj-$(CONFIG_MAGIC_SYSRQ)      += poweroff.o
index 04a9e90..bbfe472 100644 (file)
@@ -32,6 +32,7 @@ static int noresume = 0;
 static char resume_file[256] = CONFIG_PM_STD_PARTITION;
 dev_t swsusp_resume_device;
 sector_t swsusp_resume_block;
 static char resume_file[256] = CONFIG_PM_STD_PARTITION;
 dev_t swsusp_resume_device;
 sector_t swsusp_resume_block;
+int in_suspend __nosavedata = 0;
 
 enum {
        HIBERNATION_INVALID,
 
 enum {
        HIBERNATION_INVALID,
@@ -202,6 +203,35 @@ static void platform_recover(int platform_mode)
 }
 
 /**
 }
 
 /**
+ *     swsusp_show_speed - print the time elapsed between two events.
+ *     @start: Starting event.
+ *     @stop: Final event.
+ *     @nr_pages -     number of pages processed between @start and @stop
+ *     @msg -          introductory message to print
+ */
+
+void swsusp_show_speed(struct timeval *start, struct timeval *stop,
+                       unsigned nr_pages, char *msg)
+{
+       s64 elapsed_centisecs64;
+       int centisecs;
+       int k;
+       int kps;
+
+       elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start);
+       do_div(elapsed_centisecs64, NSEC_PER_SEC / 100);
+       centisecs = elapsed_centisecs64;
+       if (centisecs == 0)
+               centisecs = 1;  /* avoid div-by-zero */
+       k = nr_pages * (PAGE_SIZE / 1024);
+       kps = (k * 100) / centisecs;
+       printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
+                       msg, k,
+                       centisecs / 100, centisecs % 100,
+                       kps / 1000, (kps % 1000) / 10);
+}
+
+/**
  *     create_image - freeze devices that need to be frozen with interrupts
  *     off, create the hibernation image and thaw those devices.  Control
  *     reappears in this routine after a restore.
  *     create_image - freeze devices that need to be frozen with interrupts
  *     off, create the hibernation image and thaw those devices.  Control
  *     reappears in this routine after a restore.
index 57222d2..5b3601b 100644 (file)
 #include "power.h"
 
 int in_suspend __nosavedata = 0;
 #include "power.h"
 
 int in_suspend __nosavedata = 0;
-
-/**
- *     swsusp_show_speed - print the time elapsed between two events represented by
- *     @start and @stop
- *
- *     @nr_pages -     number of pages processed between @start and @stop
- *     @msg -          introductory message to print
- */
-
-void swsusp_show_speed(struct timeval *start, struct timeval *stop,
-                       unsigned nr_pages, char *msg)
-{
-       s64 elapsed_centisecs64;
-       int centisecs;
-       int k;
-       int kps;
-
-       elapsed_centisecs64 = timeval_to_ns(stop) - timeval_to_ns(start);
-       do_div(elapsed_centisecs64, NSEC_PER_SEC / 100);
-       centisecs = elapsed_centisecs64;
-       if (centisecs == 0)
-               centisecs = 1;  /* avoid div-by-zero */
-       k = nr_pages * (PAGE_SIZE / 1024);
-       kps = (k * 100) / centisecs;
-       printk(KERN_INFO "PM: %s %d kbytes in %d.%02d seconds (%d.%02d MB/s)\n",
-                       msg, k,
-                       centisecs / 100, centisecs % 100,
-                       kps / 1000, (kps % 1000) / 10);
-}