public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] swsusp: misc cleanups [4/4]
Date: Sat, 23 Apr 2005 23:38:43 +0200	[thread overview]
Message-ID: <200504232338.43297.rjw@sisk.pl> (raw)
In-Reply-To: <200504232320.54477.rjw@sisk.pl>

The following patch makes some comments and printk()s in swsusp.c up to date.
In particular it adds the string "swsusp" before every message that is printed by
the code in swsusp.c.

Please consider for applying.


Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

diff -Nurp b/kernel/power/swsusp.c c/kernel/power/swsusp.c
--- b/kernel/power/swsusp.c	2005-04-23 22:41:57.000000000 +0200
+++ c/kernel/power/swsusp.c	2005-04-23 22:42:38.000000000 +0200
@@ -289,7 +289,7 @@ static int data_write(void)
 	if (!mod)
 		mod = 1;
 
-	printk( "Writing data to swap (%d pages)...     ", nr_copy_pages );
+	printk( "swsusp: Writing data to swap (%d pages)...     ", nr_copy_pages );
 	for_each_pbe (p, pagedir_nosave) {
 		if (!(i%mod))
 			printk( "\b\b\b\b%3d%%", i / mod );
@@ -369,7 +369,7 @@ static int write_pagedir(void)
 	unsigned n = 0;
 	struct pbe * pbe;
 
-	printk( "Writing pagedir...");
+	printk( "swsusp: Writing pagedir ... ");
 	for_each_pb_page (pbe, pagedir_nosave) {
 		if ((error = write_page((unsigned long)pbe, &swsusp_info.pagedir[n++])))
 			return error;
@@ -563,7 +563,7 @@ static void copy_data_pages(void)
 	unsigned long zone_pfn;
 	struct pbe * pbe = pagedir_nosave;
 
-	pr_debug("copy_data_pages(): pages to copy: %d\n", nr_copy_pages);
+	pr_debug("swsusp: pages to copy: %d\n", nr_copy_pages);
 	for_each_zone (zone) {
 		if (is_highmem(zone))
 			continue;
@@ -656,14 +656,11 @@ static void create_pbe_list(struct pbe *
 			p->next = p + 1;
 		p->next = NULL;
 	}
-	pr_debug("create_pbe_list(): initialized %d PBEs\n", num);
+	pr_debug("swsusp: initialized %d PBEs\n", num);
 }
 
 /**
- *	alloc_pagedir - Allocate the page directory.
- *
- *	First, determine exactly how many pages we need and
- *	allocate them.
+ *	alloc_pagedir - Allocate the list of page backup entries.
  *
  *	We arrange the pages in a chain: each page is an array of PBES_PER_PAGE
  *	struct pbe elements (pbes) and the last element in the page points
@@ -680,7 +677,6 @@ static struct pbe * alloc_pagedir(unsign
 	if (!nr_pages)
 		return NULL;
 
-	pr_debug("alloc_pagedir(): nr_pages = %d\n", nr_pages);
 	pblist = (struct pbe *)get_zeroed_page(GFP_ATOMIC | __GFP_COLD);
 	for (pbe = pblist, num = PBES_PER_PAGE; pbe && num < nr_pages;
         		pbe = pbe->next, num += PBES_PER_PAGE) {
@@ -784,7 +780,7 @@ static int swsusp_alloc(void)
 	pagedir_nosave = NULL;
 	nr_copy_pages = calc_nr(nr_copy_pages);
 
-	pr_debug("suspend: (pages needed: %d + %d free: %d)\n",
+	pr_debug("swsusp: (pages needed: %d + %d free: %d)\n",
 		 nr_copy_pages, PAGES_FOR_IO, nr_free_pages());
 
 	if (!enough_free_mem())
@@ -794,13 +790,13 @@ static int swsusp_alloc(void)
 		return -ENOSPC;
 
 	if (!(pagedir_save = alloc_pagedir(nr_copy_pages))) {
-		printk(KERN_ERR "suspend: Allocating pagedir failed.\n");
+		printk(KERN_ERR "swsusp: Allocating pagedir failed.\n");
 		return -ENOMEM;
 	}
 	create_pbe_list(pagedir_save, nr_copy_pages);
 	pagedir_nosave = pagedir_save;
 	if ((error = alloc_image_pages())) {
-		printk(KERN_ERR "suspend: Allocating image pages failed.\n");
+		printk(KERN_ERR "swsusp: Allocating image pages failed.\n");
 		swsusp_free();
 		return error;
 	}
@@ -815,7 +811,7 @@ static int suspend_prepare_image(void)
 
 	pr_debug("swsusp: critical section: \n");
 	if (save_highmem()) {
-		printk(KERN_CRIT "Suspend machine: Not enough free pages for highmem\n");
+		printk(KERN_CRIT "swsusp: Not enough free pages for highmem\n");
 		restore_highmem();
 		return -ENOMEM;
 	}
@@ -892,7 +888,7 @@ int swsusp_suspend(void)
 	 * at resume time, and evil weirdness ensues.
 	 */
 	if ((error = device_power_down(PMSG_FREEZE))) {
-		printk(KERN_ERR "Some devices failed to power down, aborting suspend\n");
+		printk(KERN_ERR "swsusp: Some devices failed to power down, aborting suspend\n");
 		local_irq_enable();
 		swsusp_free();
 		return error;
@@ -914,7 +910,7 @@ int swsusp_resume(void)
 	int error;
 	local_irq_disable();
 	if (device_power_down(PMSG_FREEZE))
-		printk(KERN_ERR "Some devices failed to power down, very bad\n");
+		printk(KERN_ERR "swsusp: Some devices failed to power down, very bad\n");
 	/* We'll ignore saved state, but this gets preempt count (etc) right */
 	save_processor_state();
 	error = swsusp_arch_resume();
@@ -1226,9 +1222,6 @@ static int check_sig(void)
 
 /**
  *	data_read - Read image pages from swap.
- *
- *	You do not need to check for overlaps, check_pagedir()
- *	already did that.
  */
 
 static int data_read(struct pbe *pblist)

-- 
- Would you tell me, please, which way I ought to go from here?
- That depends a good deal on where you want to get to.
		-- Lewis Carroll "Alice's Adventures in Wonderland"

  parent reply	other threads:[~2005-04-23 21:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-23 21:20 [PATCH] swsusp: misc cleanups [0/4] Rafael J. Wysocki
2005-04-23 21:25 ` [PATCH] swsusp: misc cleanups [1/4] Rafael J. Wysocki
2005-04-23 22:05   ` Pavel Machek
2005-04-23 21:29 ` [PATCH] swsusp: misc cleanups [2/4] Rafael J. Wysocki
2005-04-23 22:02   ` Pavel Machek
2005-04-23 21:34 ` [PATCH] swsusp: misc cleanups [3/4] Rafael J. Wysocki
2005-04-23 22:18   ` Pavel Machek
2005-04-24 10:41     ` Rafael J. Wysocki
2005-04-24 20:23       ` Pavel Machek
2005-04-23 21:38 ` Rafael J. Wysocki [this message]
2005-04-23 22:07   ` [PATCH] swsusp: misc cleanups [4/4] Pavel Machek
2005-04-24 10:30     ` Rafael J. Wysocki
2005-04-24 20:20       ` Pavel Machek
2005-04-24 10:57     ` Stefan Seyfried
2005-04-24 20:22       ` Pavel Machek
2005-04-24 20:43         ` Stefan Seyfried
2005-04-24 21:03           ` Pavel Machek
2005-04-23 21:58 ` [PATCH] swsusp: misc cleanups [0/4] Pavel Machek
2005-04-24 10:06   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504232338.43297.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox