aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/snapshot.c19
-rw-r--r--kernel/power/swsusp.c36
2 files changed, 27 insertions, 28 deletions
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 42a628704398..723f5179883e 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -168,9 +168,8 @@ static unsigned count_data_pages(void)
168{ 168{
169 struct zone *zone; 169 struct zone *zone;
170 unsigned long zone_pfn; 170 unsigned long zone_pfn;
171 unsigned n; 171 unsigned int n = 0;
172 172
173 n = 0;
174 for_each_zone (zone) { 173 for_each_zone (zone) {
175 if (is_highmem(zone)) 174 if (is_highmem(zone))
176 continue; 175 continue;
@@ -250,10 +249,10 @@ static inline void fill_pb_page(struct pbe *pbpage)
250 * of memory pages allocated with alloc_pagedir() 249 * of memory pages allocated with alloc_pagedir()
251 */ 250 */
252 251
253void create_pbe_list(struct pbe *pblist, unsigned nr_pages) 252void create_pbe_list(struct pbe *pblist, unsigned int nr_pages)
254{ 253{
255 struct pbe *pbpage, *p; 254 struct pbe *pbpage, *p;
256 unsigned num = PBES_PER_PAGE; 255 unsigned int num = PBES_PER_PAGE;
257 256
258 for_each_pb_page (pbpage, pblist) { 257 for_each_pb_page (pbpage, pblist) {
259 if (num >= nr_pages) 258 if (num >= nr_pages)
@@ -293,9 +292,9 @@ static void *alloc_image_page(void)
293 * On each page we set up a list of struct_pbe elements. 292 * On each page we set up a list of struct_pbe elements.
294 */ 293 */
295 294
296struct pbe *alloc_pagedir(unsigned nr_pages) 295struct pbe *alloc_pagedir(unsigned int nr_pages)
297{ 296{
298 unsigned num; 297 unsigned int num;
299 struct pbe *pblist, *pbe; 298 struct pbe *pblist, *pbe;
300 299
301 if (!nr_pages) 300 if (!nr_pages)
@@ -329,7 +328,7 @@ void swsusp_free(void)
329 for_each_zone(zone) { 328 for_each_zone(zone) {
330 for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn) 329 for (zone_pfn = 0; zone_pfn < zone->spanned_pages; ++zone_pfn)
331 if (pfn_valid(zone_pfn + zone->zone_start_pfn)) { 330 if (pfn_valid(zone_pfn + zone->zone_start_pfn)) {
332 struct page * page; 331 struct page *page;
333 page = pfn_to_page(zone_pfn + zone->zone_start_pfn); 332 page = pfn_to_page(zone_pfn + zone->zone_start_pfn);
334 if (PageNosave(page) && PageNosaveFree(page)) { 333 if (PageNosave(page) && PageNosaveFree(page)) {
335 ClearPageNosave(page); 334 ClearPageNosave(page);
@@ -348,7 +347,7 @@ void swsusp_free(void)
348 * free pages. 347 * free pages.
349 */ 348 */
350 349
351static int enough_free_mem(unsigned nr_pages) 350static int enough_free_mem(unsigned int nr_pages)
352{ 351{
353 pr_debug("swsusp: available memory: %u pages\n", nr_free_pages()); 352 pr_debug("swsusp: available memory: %u pages\n", nr_free_pages());
354 return nr_free_pages() > (nr_pages + PAGES_FOR_IO + 353 return nr_free_pages() > (nr_pages + PAGES_FOR_IO +
@@ -356,7 +355,7 @@ static int enough_free_mem(unsigned nr_pages)
356} 355}
357 356
358 357
359static struct pbe *swsusp_alloc(unsigned nr_pages) 358static struct pbe *swsusp_alloc(unsigned int nr_pages)
360{ 359{
361 struct pbe *pblist, *p; 360 struct pbe *pblist, *p;
362 361
@@ -380,7 +379,7 @@ static struct pbe *swsusp_alloc(unsigned nr_pages)
380 379
381asmlinkage int swsusp_save(void) 380asmlinkage int swsusp_save(void)
382{ 381{
383 unsigned nr_pages; 382 unsigned int nr_pages;
384 383
385 pr_debug("swsusp: critical section: \n"); 384 pr_debug("swsusp: critical section: \n");
386 if (save_highmem()) { 385 if (save_highmem()) {
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
index 12db1d2ad61f..a1300717dc3f 100644
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -122,8 +122,8 @@ static struct swsusp_info swsusp_info;
122static unsigned short swapfile_used[MAX_SWAPFILES]; 122static unsigned short swapfile_used[MAX_SWAPFILES];
123static unsigned short root_swap; 123static unsigned short root_swap;
124 124
125static int write_page(unsigned long addr, swp_entry_t * loc); 125static int write_page(unsigned long addr, swp_entry_t *loc);
126static int bio_read_page(pgoff_t page_off, void * page); 126static int bio_read_page(pgoff_t page_off, void *page);
127 127
128static u8 key_iv[MAXKEY+MAXIV]; 128static u8 key_iv[MAXKEY+MAXIV];
129 129
@@ -355,7 +355,7 @@ static void lock_swapdevices(void)
355 * This is a partial improvement, since we will at least return other 355 * This is a partial improvement, since we will at least return other
356 * errors, though we need to eventually fix the damn code. 356 * errors, though we need to eventually fix the damn code.
357 */ 357 */
358static int write_page(unsigned long addr, swp_entry_t * loc) 358static int write_page(unsigned long addr, swp_entry_t *loc)
359{ 359{
360 swp_entry_t entry; 360 swp_entry_t entry;
361 int error = 0; 361 int error = 0;
@@ -383,7 +383,7 @@ static int write_page(unsigned long addr, swp_entry_t * loc)
383static void data_free(void) 383static void data_free(void)
384{ 384{
385 swp_entry_t entry; 385 swp_entry_t entry;
386 struct pbe * p; 386 struct pbe *p;
387 387
388 for_each_pbe(p, pagedir_nosave) { 388 for_each_pbe(p, pagedir_nosave) {
389 entry = p->swap_address; 389 entry = p->swap_address;
@@ -492,8 +492,8 @@ static void free_pagedir_entries(void)
492static int write_pagedir(void) 492static int write_pagedir(void)
493{ 493{
494 int error = 0; 494 int error = 0;
495 unsigned n = 0; 495 unsigned int n = 0;
496 struct pbe * pbe; 496 struct pbe *pbe;
497 497
498 printk( "Writing pagedir..."); 498 printk( "Writing pagedir...");
499 for_each_pb_page (pbe, pagedir_nosave) { 499 for_each_pb_page (pbe, pagedir_nosave) {
@@ -543,7 +543,7 @@ static int write_suspend_image(void)
543 * We should only consider resume_device. 543 * We should only consider resume_device.
544 */ 544 */
545 545
546int enough_swap(unsigned nr_pages) 546int enough_swap(unsigned int nr_pages)
547{ 547{
548 struct sysinfo i; 548 struct sysinfo i;
549 549
@@ -694,7 +694,7 @@ static int check_pagedir(struct pbe *pblist)
694 * restore from the loaded pages later. We relocate them here. 694 * restore from the loaded pages later. We relocate them here.
695 */ 695 */
696 696
697static struct pbe * swsusp_pagedir_relocate(struct pbe *pblist) 697static struct pbe *swsusp_pagedir_relocate(struct pbe *pblist)
698{ 698{
699 struct zone *zone; 699 struct zone *zone;
700 unsigned long zone_pfn; 700 unsigned long zone_pfn;
@@ -770,7 +770,7 @@ static struct pbe * swsusp_pagedir_relocate(struct pbe *pblist)
770 770
771static atomic_t io_done = ATOMIC_INIT(0); 771static atomic_t io_done = ATOMIC_INIT(0);
772 772
773static int end_io(struct bio * bio, unsigned int num, int err) 773static int end_io(struct bio *bio, unsigned int num, int err)
774{ 774{
775 if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) 775 if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
776 panic("I/O error reading memory image"); 776 panic("I/O error reading memory image");
@@ -778,7 +778,7 @@ static int end_io(struct bio * bio, unsigned int num, int err)
778 return 0; 778 return 0;
779} 779}
780 780
781static struct block_device * resume_bdev; 781static struct block_device *resume_bdev;
782 782
783/** 783/**
784 * submit - submit BIO request. 784 * submit - submit BIO request.
@@ -791,10 +791,10 @@ static struct block_device * resume_bdev;
791 * Then submit it and wait. 791 * Then submit it and wait.
792 */ 792 */
793 793
794static int submit(int rw, pgoff_t page_off, void * page) 794static int submit(int rw, pgoff_t page_off, void *page)
795{ 795{
796 int error = 0; 796 int error = 0;
797 struct bio * bio; 797 struct bio *bio;
798 798
799 bio = bio_alloc(GFP_ATOMIC, 1); 799 bio = bio_alloc(GFP_ATOMIC, 1);
800 if (!bio) 800 if (!bio)
@@ -823,12 +823,12 @@ static int submit(int rw, pgoff_t page_off, void * page)
823 return error; 823 return error;
824} 824}
825 825
826static int bio_read_page(pgoff_t page_off, void * page) 826static int bio_read_page(pgoff_t page_off, void *page)
827{ 827{
828 return submit(READ, page_off, page); 828 return submit(READ, page_off, page);
829} 829}
830 830
831static int bio_write_page(pgoff_t page_off, void * page) 831static int bio_write_page(pgoff_t page_off, void *page)
832{ 832{
833 return submit(WRITE, page_off, page); 833 return submit(WRITE, page_off, page);
834} 834}
@@ -838,7 +838,7 @@ static int bio_write_page(pgoff_t page_off, void * page)
838 * I really don't think that it's foolproof but more than nothing.. 838 * I really don't think that it's foolproof but more than nothing..
839 */ 839 */
840 840
841static const char * sanity_check(void) 841static const char *sanity_check(void)
842{ 842{
843 dump_info(); 843 dump_info();
844 if (swsusp_info.version_code != LINUX_VERSION_CODE) 844 if (swsusp_info.version_code != LINUX_VERSION_CODE)
@@ -864,7 +864,7 @@ static const char * sanity_check(void)
864 864
865static int check_header(void) 865static int check_header(void)
866{ 866{
867 const char * reason = NULL; 867 const char *reason = NULL;
868 int error; 868 int error;
869 869
870 if ((error = bio_read_page(swp_offset(swsusp_header.swsusp_info), &swsusp_info))) 870 if ((error = bio_read_page(swp_offset(swsusp_header.swsusp_info), &swsusp_info)))
@@ -912,7 +912,7 @@ static int check_sig(void)
912 912
913static int data_read(struct pbe *pblist) 913static int data_read(struct pbe *pblist)
914{ 914{
915 struct pbe * p; 915 struct pbe *p;
916 int error = 0; 916 int error = 0;
917 int i = 0; 917 int i = 0;
918 int mod = swsusp_info.image_pages / 100; 918 int mod = swsusp_info.image_pages / 100;
@@ -950,7 +950,7 @@ static int data_read(struct pbe *pblist)
950static int read_pagedir(struct pbe *pblist) 950static int read_pagedir(struct pbe *pblist)
951{ 951{
952 struct pbe *pbpage, *p; 952 struct pbe *pbpage, *p;
953 unsigned i = 0; 953 unsigned int i = 0;
954 int error; 954 int error;
955 955
956 if (!pblist) 956 if (!pblist)